Struct Timeout

#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct Timeout<T> { /* private fields */ }

Future returned by timeout and timeout_at.

Implementations

impl<T> Timeout<T>

fn get_ref(&self) -> &T

Gets a reference to the underlying value in this timeout.

fn get_mut(&mut self) -> &mut T

Gets a mutable reference to the underlying value in this timeout.

fn into_inner(self) -> T

Consumes this timeout, returning the underlying value.

Trait Implementations

impl<'__pin, T> Unpin for Timeout<T> where PinnedFieldsOf<__Origin<'__pin, T>>: Unpin,

impl<T> Future for Timeout<T> where T: Future,

type Output = Result<<T as Future>::Output, Elapsed>;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

impl<T: Debug> Debug for Timeout<T>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<T> !Freeze for Timeout<T>

impl<T> !RefUnwindSafe for Timeout<T>

impl<T> !UnsafeUnpin for Timeout<T>

impl<T> !UnwindSafe for Timeout<T>

impl<T> Send for Timeout<T> where T: Send,

impl<T> Sync for Timeout<T> where T: Sync,

Blanket Implementations

impl<F> IntoFuture for Timeout<T> where F: Future,

type Output = <F as Future>::Output;
type IntoFuture = F;
fn into_future(self) -> <F as IntoFuture>::IntoFuture

impl<T> Any for Timeout<T> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Timeout<T> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Timeout<T> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for Timeout<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for Timeout<T> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Timeout<T> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Timeout<T> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>