Struct libp2prs_core::multistream::Negotiator[][src]

pub struct Negotiator<TProto> { /* fields omitted */ }

Implementations

impl<TProto: AsRef<[u8]> + Clone + Debug> Negotiator<TProto>[src]

pub fn new_with_protocols<Iter>(protocols: Iter) -> Self where
    Iter: IntoIterator<Item = TProto>, 
[src]

pub fn add_protocol(&mut self, proto: TProto) -> Result<(), ProtocolError>[src]

pub async fn negotiate<TSocket>(
    &self,
    socket: TSocket
) -> Result<(TProto, TSocket), NegotiationError> where
    TSocket: AsyncRead + AsyncWrite + Unpin
[src]

pub async fn select_one<TSocket>(
    &self,
    socket: TSocket
) -> Result<(TProto, TSocket), NegotiationError> where
    TSocket: AsyncRead + AsyncWrite + Unpin
[src]

Trait Implementations

impl<TProto> Default for Negotiator<TProto>[src]

Auto Trait Implementations

impl<TProto> RefUnwindSafe for Negotiator<TProto> where
    TProto: RefUnwindSafe

impl<TProto> Send for Negotiator<TProto> where
    TProto: Send

impl<TProto> Sync for Negotiator<TProto> where
    TProto: Sync

impl<TProto> Unpin for Negotiator<TProto> where
    TProto: Unpin

impl<TProto> UnwindSafe for Negotiator<TProto> where
    TProto: UnwindSafe

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