Trait libp2p_networking::network::transport::AsOutput
source · trait AsOutput<C: StreamMuxer + Unpin> {
// Required methods
fn as_connection(&mut self) -> &mut C;
fn as_peer_id(&mut self) -> &mut PeerId;
}
Expand description
A helper trait that allows us to access the underlying connection
and PeerId
from a transport output
Required Methods§
sourcefn as_connection(&mut self) -> &mut C
fn as_connection(&mut self) -> &mut C
Get a mutable reference to the underlying connection
sourcefn as_peer_id(&mut self) -> &mut PeerId
fn as_peer_id(&mut self) -> &mut PeerId
Get a mutable reference to the underlying PeerId
Implementations on Foreign Types§
source§impl<C: StreamMuxer + Unpin> AsOutput<C> for (PeerId, C)
impl<C: StreamMuxer + Unpin> AsOutput<C> for (PeerId, C)
The implementation of the AsConnection
trait for a tuple of a PeerId
and a connection.
source§fn as_connection(&mut self) -> &mut C
fn as_connection(&mut self) -> &mut C
Get a mutable reference to the underlying connection
source§fn as_peer_id(&mut self) -> &mut PeerId
fn as_peer_id(&mut self) -> &mut PeerId
Get a mutable reference to the underlying PeerId