pub struct Timeout<T> { /* private fields */ }Implementations§
Source§impl<T> Timeout<T>
impl<T> Timeout<T>
pub fn new(inner: T, timeout: Duration) -> Self
pub fn outgoing_timeout(&self) -> Duration
pub fn incoming_timeout(&self) -> Duration
pub fn with_outgoing_timeout(self, timeout: Duration) -> Self
pub fn with_incoming_timeout(self, timeout: Duration) -> Self
Trait Implementations§
Source§impl<T> Transport for Timeout<T>
impl<T> Transport for Timeout<T>
type Output = <T as Transport>::Output
type Error = TimeoutError<<T as Transport>::Error>
type Dial = TimeoutFuture<<T as Transport>::Dial>
type Incoming = TimeoutFuture<<T as Transport>::Incoming>
type Listener = TimeoutListener<T>
fn dial( &self, addr: Multiaddr, ) -> Result<Self::Dial, TransportError<Self::Error>>
fn listen( &self, addr: Multiaddr, ) -> Result<Self::Listener, TransportError<Self::Error>>
fn and_then<D, TMap, TMapFut>(self, map: TMap) -> AndThen<Self, TMap>
fn map<D, TMap>(self, map: TMap) -> Map<Self, TMap>
fn map_err<TErr, F>(self, map: F) -> MapErr<Self, F>
fn apply<C, D, E, U>(self, upgrade: U) -> UpgradeApply<Self, U>where
Self: Sized + Transport<Output = C>,
U: InboundConnectionUpgrade<Negotiated<C>, Output = D, Error = E> + OutboundConnectionUpgrade<Negotiated<C>, Output = D, Error = E>,
E: Error,
fn choice<B>(self, other: B) -> Choice<Self, B>
fn timeout(self, timeout: Duration) -> Timeout<Self>where
Self: Sized,
fn boxed(self) -> Boxed<Self::Output>
fn upgrade(self) -> Builder<Self>
Auto Trait Implementations§
impl<T> Freeze for Timeout<T>where
T: Freeze,
impl<T> RefUnwindSafe for Timeout<T>where
T: RefUnwindSafe,
impl<T> Send for Timeout<T>where
T: Send,
impl<T> Sync for Timeout<T>where
T: Sync,
impl<T> Unpin for Timeout<T>where
T: Unpin,
impl<T> UnsafeUnpin for Timeout<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Timeout<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more