pub struct AndThen<T, F> { /* private fields */ }Expand description
An AndThen is a transport which applies a closure (F) to all connections created by the
underlying transport.
Trait Implementations§
source§impl<T, F, Fut, O> Transport for AndThen<T, F>where
    T: Transport,
    F: FnOnce(T::Output, NetworkAddress, ConnectionOrigin) -> Fut + Send + Unpin + Clone,
    Fut: Future<Output = Result<O, T::Error>> + Send,
 
impl<T, F, Fut, O> Transport for AndThen<T, F>where T: Transport, F: FnOnce(T::Output, NetworkAddress, ConnectionOrigin) -> Fut + Send + Unpin + Clone, Fut: Future<Output = Result<O, T::Error>> + Send,
§type Error = <T as Transport>::Error
 
type Error = <T as Transport>::Error
The Error type of errors which can happen while establishing a connection.
§type Listener = AndThenStream<<T as Transport>::Listener, F>
 
type Listener = AndThenStream<<T as Transport>::Listener, F>
§type Inbound = AndThenFuture<<T as Transport>::Inbound, Fut, F>
 
type Inbound = AndThenFuture<<T as Transport>::Inbound, Fut, F>
§type Outbound = AndThenFuture<<T as Transport>::Outbound, Fut, F>
 
type Outbound = AndThenFuture<<T as Transport>::Outbound, Fut, F>
Auto Trait Implementations§
impl<T, F> RefUnwindSafe for AndThen<T, F>where F: RefUnwindSafe, T: RefUnwindSafe,
impl<T, F> Send for AndThen<T, F>where F: Send, T: Send,
impl<T, F> Sync for AndThen<T, F>where F: Sync, T: Sync,
impl<T, F> Unpin for AndThen<T, F>where F: Unpin, T: Unpin,
impl<T, F> UnwindSafe for AndThen<T, F>where F: UnwindSafe, T: UnwindSafe,
Blanket Implementations§
source§impl<T> Instrument for T
 
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> TransportExt for Twhere
    T: Transport + ?Sized,
 
impl<T> TransportExt for Twhere T: Transport + ?Sized,
source§fn boxed(self) -> BoxedTransport<Self::Output, Self::Error>where
    Self: Sized + Send + 'static,
    Self::Listener: Send + 'static,
    Self::Inbound: Send + 'static,
    Self::Outbound: Send + 'static,
 
fn boxed(self) -> BoxedTransport<Self::Output, Self::Error>where Self: Sized + Send + 'static, Self::Listener: Send + 'static, Self::Inbound: Send + 'static, Self::Outbound: Send + 'static,
Turns a 
Transport into an abstract boxed transport.source§fn and_then<F, Fut, O>(self, f: F) -> AndThen<Self, F>where
    Self: Sized,
    F: FnOnce(Self::Output, NetworkAddress, ConnectionOrigin) -> Fut + Clone,
    Fut: Future<Output = Result<O, Self::Error>>,
 
fn and_then<F, Fut, O>(self, f: F) -> AndThen<Self, F>where Self: Sized, F: FnOnce(Self::Output, NetworkAddress, ConnectionOrigin) -> Fut + Clone, Fut: Future<Output = Result<O, Self::Error>>,
Applies a function producing an asynchronous result to every connection
created by this transport. Read more