Skip to main content

TaskOptions

Struct TaskOptions 

pub struct TaskOptions {
    pub queue: QueueSupport,
    pub capture_panic_backtrace: bool,
}
Expand description

创建选项;不代表已经提交(submission)或接纳(admission)。

Fields§

§queue: QueueSupport

Plain不分配链接空间;IntrusiveLocal可进入默认TaskQueue。

§capture_panic_backtrace: bool

允许宿主钩子在恐慌(panic)起点采集本次轮询记录;本库不安装全局钩子。

Implementations§

§

impl TaskOptions

pub fn plain() -> Self

构造无链接、无观测的默认选项;不创建任务(Task)。

§

impl TaskOptions

pub fn intrusive() -> Self

构造可放入默认TaskQueue的选项,默认关闭可选观测(observation)与堆栈采集(backtrace capture)。

§

impl TaskOptions

pub fn intrusive_mpsc() -> Self

选择仅携带MPSC链接(link)的任务(Task),不支持本地双端队列(deque)。

不创建、提交(submission)或轮询(poll)任务(Task); 默认关闭可选观测(observation)和堆栈采集(backtrace capture)。 构造选项的时间、额外空间为O(1),不分配、不等待、不调用用户代码。

§

impl TaskOptions

pub fn intrusive_local_and_mpsc() -> Self

选择同时携带本地双端队列(deque)与MPSC独立链接(link)的任务(Task)。

任务(Task)只创建一次,两套链接(link)随原存储(storage)准备; 使用时仍须从一类队列(queue)安全取回,再交给另一类,不能同时入队(enqueue)。 本方法只构造选项,O(1)时间及额外空间;不分配、不等待、不调用用户代码。 默认关闭可选观测(observation)和堆栈采集(backtrace capture)。

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