Skip to main content

TaskParts

Struct TaskParts 

pub struct TaskParts<T, M: Send + Sync + 'static = (), K: OutputMode = SendOutput> {
    pub runnable: Runnable,
    pub control: ControlHandle,
    pub join: JoinHandle<T, M, K>,
}
Expand description

创建成功的三类权限;创建本身不提交(submission)、接纳(admission)或轮询(poll)。

Fields§

§runnable: Runnable

唯一可执行持有;可交给合法执行组织。

§control: ControlHandle

共享查询与控制,不能领取输出(output)或访问原值。

§join: JoinHandle<T, M, K>

唯一结果领取权;释放它不自动取消任务(Task)。

Auto Trait Implementations§

§

impl<T, M = (), K = SendOutput> !RefUnwindSafe for TaskParts<T, M, K>

§

impl<T, M = (), K = SendOutput> !UnwindSafe for TaskParts<T, M, K>

§

impl<T, M, K> Forget for TaskParts<T, M, K>

§

impl<T, M, K> Freeze for TaskParts<T, M, K>
where JoinHandle<T, M, K>: Freeze,

§

impl<T, M, K> Move for TaskParts<T, M, K>

§

impl<T, M, K> Send for TaskParts<T, M, K>
where JoinHandle<T, M, K>: Send,

§

impl<T, M, K> Sync for TaskParts<T, M, K>
where JoinHandle<T, M, K>: Sync,

§

impl<T, M, K> Unpin for TaskParts<T, M, K>
where JoinHandle<T, M, K>: Unpin,

§

impl<T, M, K> UnsafeUnpin for TaskParts<T, M, K>
where JoinHandle<T, M, K>: UnsafeUnpin,

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> 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, 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.