Struct multistream_select::Negotiated[][src]

pub struct Negotiated<TInner> { /* fields omitted */ }

An I/O stream that has settled on an (application-layer) protocol to use.

A Negotiated represents an I/O stream that has settled on a protocol to use. In particular, it is not implied that all of the protocol negotiation frames have yet been sent and / or received, just that the selected protocol is fully determined. This is to allow the last protocol negotiation frames sent by a peer to be combined in a single write, possibly piggy-backing data from the negotiated protocol on top.

Reading from a Negotiated I/O stream that still has pending negotiation protocol data to send implicitly triggers flushing of all yet unsent data.

Implementations

impl<TInner> Negotiated<TInner>[src]

pub fn complete(self) -> NegotiatedComplete<TInner>

Notable traits for NegotiatedComplete<TInner>

impl<TInner> Future for NegotiatedComplete<TInner> where
    TInner: AsyncRead + AsyncWrite + Unpin
type Output = Result<Negotiated<TInner>, NegotiationError>;
[src]

Returns a NegotiatedComplete future that waits for protocol negotiation to complete.

Trait Implementations

impl<TInner> AsyncRead for Negotiated<TInner> where
    TInner: AsyncRead + AsyncWrite + Unpin
[src]

impl<TInner> AsyncWrite for Negotiated<TInner> where
    TInner: AsyncWrite + AsyncRead + Unpin
[src]

impl<TInner: Debug> Debug for Negotiated<TInner>[src]

impl<'pin, TInner> Unpin for Negotiated<TInner> where
    __Negotiated<'pin, TInner>: Unpin
[src]

Auto Trait Implementations

impl<TInner> RefUnwindSafe for Negotiated<TInner> where
    TInner: RefUnwindSafe

impl<TInner> Send for Negotiated<TInner> where
    TInner: Send

impl<TInner> Sync for Negotiated<TInner> where
    TInner: Sync

impl<TInner> UnwindSafe for Negotiated<TInner> where
    TInner: UnwindSafe

Blanket Implementations

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

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized
[src]

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?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, 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.