[][src]Struct libp2prs_yamux::Yamux

pub struct Yamux<C: SplitEx> {
    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 Yamux 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 + SplittableReadWrite> Yamux<C>[src]

pub fn new(io: C, mut cfg: Config, mode: Mode) -> Self[src]

Create a new Yamux connection.

Trait Implementations

impl<C: SplitEx> Clone for Yamux<C>[src]

impl<C: SplitEx> ConnectionInfo for Yamux<C>[src]

impl<C: SplitEx> Debug for Yamux<C>[src]

impl<C: SplitEx> SecureInfo for Yamux<C>[src]

impl<C: SplittableReadWrite> StreamMuxer for Yamux<C>[src]

impl<C: SplittableReadWrite> StreamMuxerEx for Yamux<C>[src]

Auto Trait Implementations

impl<C> !RefUnwindSafe for Yamux<C>[src]

impl<C> Send for Yamux<C>[src]

impl<C> !Sync for Yamux<C>[src]

impl<C> Unpin for Yamux<C>[src]

impl<C> !UnwindSafe for Yamux<C>[src]

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>,