跳到主要内容

Coop

搜索

结构体 Coop 

源代码
pub struct Coop<F: Future> { /* 私有字段 */ }
展开描述

cooperative 创建的用于确保协作调度的 future 包装器。

trait 实现§

源代码§

impl<F: Future> Future for Coop<F>

Available on crate features fs or io-std or net or process or rt or signal or sync or time only.
源代码§

type Output = <F as Future>::Output

Future 完成时产生的值的类型。
源代码§

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. 更多信息
源代码§

impl<'__pin, F: Future> Unpin for Coop<F>
where PinnedFieldsOf<__Origin<'__pin, F>>: Unpin,

自动 trait 实现§

§

impl<F> Freeze for Coop<F>
where F: Freeze,

§

impl<F> RefUnwindSafe for Coop<F>
where F: RefUnwindSafe,

§

impl<F> Send for Coop<F>
where F: Send,

§

impl<F> Sync for Coop<F>
where F: Sync,

§

impl<F> UnsafeUnpin for Coop<F>
where F: UnsafeUnpin,

§

impl<F> UnwindSafe for Coop<F>
where F: UnwindSafe,

blanket 实现§

源代码§

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

源代码§

fn type_id(&self) -> TypeId

Gets the TypeId of self. 更多信息
源代码§

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

源代码§

fn borrow(&self) -> &T

Immutably borrows from an owned value. 更多信息
源代码§

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

源代码§

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

Mutably borrows from an owned value. 更多信息
源代码§

impl<T> From<T> for T

源代码§

fn from(t: T) -> T

原样返回参数。

源代码§

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

源代码§

fn into(self) -> U

调用 U::from(self)

也就是说,此转换是 From<T> for U 实现选择执行的操作。

源代码§

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

源代码§

type Output = <F as Future>::Output

Future 完成时产生的输出。
源代码§

type IntoFuture = F

我们将要把此值转变成哪种 future?
源代码§

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

Creates a future from a value. 更多信息
源代码§

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

源代码§

type Error = Infallible

转换出错时返回的类型。
源代码§

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

执行转换。
源代码§

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

源代码§

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

转换出错时返回的类型。
源代码§

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

执行转换。