pub struct Timeout<T> { /* private fields */ }Implementations§
Source§impl<T> Timeout<T>
impl<T> Timeout<T>
Sourcepub fn from_stream(inner: T, duration: Duration) -> Selfwhere
T: Stream,
pub fn from_stream(inner: T, duration: Duration) -> Selfwhere
T: Stream,
Create a timeout from a stream
Sourcepub fn from_future(inner: T, duration: Duration) -> Selfwhere
T: Future,
pub fn from_future(inner: T, duration: Duration) -> Selfwhere
T: Future,
Create a timeout from a future
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes Timeout and returns the inner value
Trait Implementations§
Source§impl<T: Future> FusedFuture for Timeout<T>
impl<T: Future> FusedFuture for Timeout<T>
Source§fn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
Returns
true if the underlying future should no longer be polled.Source§impl<T: Stream> FusedStream for Timeout<T>
impl<T: Stream> FusedStream for Timeout<T>
Source§fn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
Returns
true if the stream should no longer be polled.Source§impl<T: Future> Future for Timeout<T>
impl<T: Future> Future for Timeout<T>
Source§impl<T: Stream> Stream for Timeout<T>
impl<T: Stream> Stream for Timeout<T>
impl<'pin, T> Unpin for Timeout<T>where
PinnedFieldsOf<__Timeout<'pin, T>>: Unpin,
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Timeout<T>
impl<T> !UnwindSafe for Timeout<T>
impl<T> Freeze for Timeout<T>where
T: Freeze,
impl<T> Send for Timeout<T>where
T: Send,
impl<T> Sync for Timeout<T>where
T: Sync,
impl<T> UnsafeUnpin for Timeout<T>where
T: UnsafeUnpin,
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<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more