Struct libp2prs_mplex::Mplex[][src]

pub struct Mplex<C> {
    pub la: Multiaddr,
    pub ra: Multiaddr,
    pub local_priv_key: Keypair,
    pub local_peer_id: PeerId,
    pub remote_pub_key: PublicKey,
    pub remote_peer_id: PeerId,
    // some fields omitted
}

A Mplex connection.

This implementation isn’t capable of detecting when the underlying socket changes its address, and no [StreamMuxerEvent::AddressChange] event is ever emitted.

Fields

la: Multiaddr

The secure&connection info provided by underlying socket. The socket is moved into Connection, so we have to make a copy of these information

The local multiaddr of this connection

ra: Multiaddr

The remote multiaddr of this connection

local_priv_key: Keypair

The private key of the local

local_peer_id: PeerId

For convenience, the local peer ID, generated from local pub key

remote_pub_key: PublicKey

The public key of the remote.

remote_peer_id: PeerId

For convenience, put a PeerId here, which is actually calculated from remote_key

Implementations

impl<C: ConnectionInfo + SecureInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static> Mplex<C>[src]

pub fn new(io: C) -> Self[src]

Trait Implementations

impl<C> Clone for Mplex<C>[src]

impl<C: Send> ConnectionInfo for Mplex<C>[src]

impl<C> Debug for Mplex<C>[src]

impl<C> SecureInfo for Mplex<C>[src]

impl<C: AsyncRead + AsyncWrite + Send + Unpin + 'static> StreamMuxer for Mplex<C>[src]

impl<C: AsyncRead + AsyncWrite + Send + Unpin + 'static> StreamMuxerEx for Mplex<C>[src]

Auto Trait Implementations

impl<C> !RefUnwindSafe for Mplex<C>

impl<C> Send for Mplex<C> where
    C: Send

impl<C> Sync for Mplex<C> where
    C: Send

impl<C> Unpin for Mplex<C>

impl<C> !UnwindSafe for Mplex<C>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,