Struct libp2p::simple::SimpleProtocol [−][src]
pub struct SimpleProtocol<F> { /* fields omitted */ }
Expand description
Implementation of ConnectionUpgrade
. Convenient to use with small protocols.
Implementations
Builds a SimpleProtocol
.
Trait Implementations
impl<C, F, O, A, E> InboundUpgrade<C> for SimpleProtocol<F> where
C: AsyncRead + AsyncWrite,
F: Fn(C) -> O,
O: Future<Output = Result<A, E>>,
[src]
impl<C, F, O, A, E> InboundUpgrade<C> for SimpleProtocol<F> where
C: AsyncRead + AsyncWrite,
F: Fn(C) -> O,
O: Future<Output = Result<A, E>>,
[src]type Output = A
type Output = A
Output after the upgrade has been successfully negotiated and the handshake performed.
type Error = E
type Error = E
Possible error during the handshake.
type Future = O
type Future = O
Future that performs the handshake with the remote.
After we have determined that the remote supports one of the protocols we support, this method is called to start the handshake. Read more
impl<C, F, O, A, E> OutboundUpgrade<C> for SimpleProtocol<F> where
C: AsyncRead + AsyncWrite,
F: Fn(C) -> O,
O: Future<Output = Result<A, E>>,
[src]
impl<C, F, O, A, E> OutboundUpgrade<C> for SimpleProtocol<F> where
C: AsyncRead + AsyncWrite,
F: Fn(C) -> O,
O: Future<Output = Result<A, E>>,
[src]type Output = A
type Output = A
Output after the upgrade has been successfully negotiated and the handshake performed.
type Error = E
type Error = E
Possible error during the handshake.
type Future = O
type Future = O
Future that performs the handshake with the remote.
After we have determined that the remote supports one of the protocols we support, this method is called to start the handshake. Read more
Auto Trait Implementations
impl<F> RefUnwindSafe for SimpleProtocol<F> where
F: RefUnwindSafe,
impl<F> Send for SimpleProtocol<F> where
F: Send + Sync,
impl<F> Sync for SimpleProtocol<F> where
F: Send + Sync,
impl<F> Unpin for SimpleProtocol<F>
impl<F> UnwindSafe for SimpleProtocol<F> where
F: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
fn map_inbound<F, T>(self, f: F) -> MapInboundUpgrade<Self, F> where
F: FnOnce(Self::Output) -> T,
[src]
fn map_inbound<F, T>(self, f: F) -> MapInboundUpgrade<Self, F> where
F: FnOnce(Self::Output) -> T,
[src]Returns a new object that wraps around Self
and applies a closure to the Output
.
fn map_inbound_err<F, T>(self, f: F) -> MapInboundUpgradeErr<Self, F> where
F: FnOnce(Self::Error) -> T,
[src]
fn map_inbound_err<F, T>(self, f: F) -> MapInboundUpgradeErr<Self, F> where
F: FnOnce(Self::Error) -> T,
[src]Returns a new object that wraps around Self
and applies a closure to the Error
.
fn map_outbound<F, T>(self, f: F) -> MapOutboundUpgrade<Self, F> where
F: FnOnce(Self::Output) -> T,
[src]
fn map_outbound<F, T>(self, f: F) -> MapOutboundUpgrade<Self, F> where
F: FnOnce(Self::Output) -> T,
[src]Returns a new object that wraps around Self
and applies a closure to the Output
.
fn map_outbound_err<F, T>(self, f: F) -> MapOutboundUpgradeErr<Self, F> where
F: FnOnce(Self::Error) -> T,
[src]
fn map_outbound_err<F, T>(self, f: F) -> MapOutboundUpgradeErr<Self, F> where
F: FnOnce(Self::Error) -> T,
[src]Returns a new object that wraps around Self
and applies a closure to the Error
.
pub fn vzip(self) -> V