Skip to main content

FutureDropStatus

Enum FutureDropStatus 

pub enum FutureDropStatus {
    Unconfirmed,
    Confirmed,
}
Expand description

描述原异步计算(Future)的合法析构(drop)是否已经确认完成。

本值只描述原异步计算(Future)的清理确认,不说明取消(cancellation)是否成功, 也不说明执行结果(output)、其它共享资源或任务(Task)存储是否已经释放。 正常完成路径和取消(cancellation)路径使用相同含义。 同一目标一旦给出完成确认,就不会回退;本值是历史描述,不会自行更新。

§使用示例(Usage)

use pi_async_task::definitions::FutureDropStatus;

let description = FutureDropStatus::Unconfirmed;
assert_ne!(description, FutureDropStatus::Confirmed);

构造本值不会执行析构(drop),也不能证明实际原值已完成清理。 本类型(type)不持有原值、不提供实时查询,也不授予资源访问或清理权限。

§成本与安全(Cost and safety)

普通构造、复制(copy)及相等比较均为 O(1),无需堆分配、锁(lock)、 异步等待(await)或用户回调(callback),不改变实际任务(Task)。 本值可跨线程转移(Send)或通过共享引用在线程(thread)间读取(Sync)。 调试(debug)输出取决于格式化(formatting)目标;不保证其固定成本或无失败。 不保证内存布局(memory layout)、判别值(discriminant)数值或稳定外部编码。

Variants§

§

Unconfirmed

尚未确认原异步计算(Future)已经完成合法析构(drop)。

包括尚未开始、正在进行、尚未发布完成确认或发生失败的情况; 不表示原值一定仍然存在,也不允许据此重复析构(drop)。

§

Confirmed

原异步计算(Future)已经完成合法析构(drop),并已发布完成确认。

不表示全部任务(Task)责任、外部输入输出(I/O)或剩余存储已经结束。

Trait Implementations§

Source§

impl Clone for FutureDropStatus

Source§

fn clone(&self) -> FutureDropStatus

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for FutureDropStatus

Source§

impl Debug for FutureDropStatus

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for FutureDropStatus

Source§

impl PartialEq for FutureDropStatus

Source§

fn eq(&self, other: &FutureDropStatus) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FutureDropStatus

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> OpaqueAttachment for T
where T: Send + Sync + 'static,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.