跳到主要内容

Timeout

搜索

结构体 Timeout 

Source
pub struct Timeout<T> { /* private fields */ }
展开描述

timeouttimeout_at 返回的 Future。

实现§

Source§

impl<T> Timeout<T>

Source

pub fn get_ref(&self) -> &T

获取此 timeout 中底层值的引用。

Source

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

获取此 timeout 中底层值的可变引用。

Source

pub fn into_inner(self) -> T

消费此 timeout,返回底层值。

Trait 实现§

Source§

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

Source§

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

使用给定的格式化器格式化此值。 更多信息
Source§

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

Source§

type Output = Result<<T as Future>::Output, Elapsed>

Future 完成时产生的值的类型。
Source§

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

Attempts to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. 更多信息
Source§

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

自动 Trait 实现§

§

impl<T> !Freeze for Timeout<T>

§

impl<T> !RefUnwindSafe for Timeout<T>

§

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

§

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

§

impl<T> !UnsafeUnpin for Timeout<T>

§

impl<T> !UnwindSafe for Timeout<T>

Blanket 实现§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. 更多信息
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. 更多信息
Source§

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

Source§

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

Mutably borrows from an owned value. 更多信息
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

原样返回传入的参数。

Source§

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

Source§

fn into(self) -> U

调用 U::from(self)

也就是说,此转换的具体行为取决于 From<T> for U 的实现方式。

Source§

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

Source§

type Output = <F as Future>::Output

Future 完成时产生的输出。
Source§

type IntoFuture = F

我们将要把此值转变成哪种 future?
Source§

fn into_future(self) -> <F as IntoFuture>::IntoFuture

Creates a future from a value. 更多信息
Source§

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

Source§

type Error = Infallible

转换出错时返回的类型。
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

执行转换。
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

转换出错时返回的类型。
Source§

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

执行转换。