Skip to main content

ExecutorSnapshot

Struct ExecutorSnapshot 

Source
pub struct ExecutorSnapshot<'a> {
Show 14 fields pub runtime: RuntimeId, pub status: RuntimeStatus, pub external_tasks: usize, pub internal_tasks: usize, pub ready_tasks: usize, pub external_deferred: bool, pub returns_deferred: bool, pub timer_registrations: usize, pub idle_tasks: usize, pub in_flight_tasks: usize, pub can_admit_external: bool, pub timer_work_pending: bool, pub maintenance_pending: bool, pub last_idle_state: IdleState, /* private fields */
}
Expand description

本轮独立取样的只读输入,不持队列(queue)、任务原值或借用守卫(guard)。

Fields§

§runtime: RuntimeId§status: RuntimeStatus§external_tasks: usize

普通外部来源已接收但尚未交付或合法清理的数量样本,不等于当前可立即取出的数量。

§internal_tasks: usize§ready_tasks: usize

真正线程内容器的待取数量;与包含发布过程的internal_tasks不同。

§external_deferred: bool

本轮已作有限尝试但发布或消费暂不可完成;总数量不能推翻这一事实。

§returns_deferred: bool

本轮原归属回送经有限尝试仍暂不可取,不能以回送在途数量推翻该分类。

§timer_registrations: usize

定时来源仍承担责任的登记数量,包含纯计时信号,不代表均为业务任务(Task)或已经到期。

§idle_tasks: usize

空闲来源尚保管的任务(Task)数量,不保证已接纳或可立即执行。

§in_flight_tasks: usize

已接纳且自身原值责任未结束的任务(Task)数量;未确认清理失败仍保留,不由队列数量相减推导。

§can_admit_external: bool

当前运行时(runtime)的固定接纳规则是否允许本轮取普通外部新业务。

§timer_work_pending: bool

原定时来源仍有可立即推进的到期发现/交付,不以登记总数非零替代。

§maintenance_pending: bool

尚有管理责任;不自动等价于业务可执行或无限忙等。

§last_idle_state: IdleState

Implementations§

Source§

impl ExecutorSnapshot<'_>

Source

pub fn waiting_for_wake_tasks(&self) -> usize

按需O(n)扫描;默认策略不调用,不把成本强加给每次事件循环(event loop)。

Source

pub fn pending_cancel_tasks(&self) -> usize

与其它数量独立取样;不保存任务(Task)原值或可写借用。

Trait Implementations§

Source§

impl<'a> Clone for ExecutorSnapshot<'a>

Source§

fn clone(&self) -> Self

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<'a> Copy for ExecutorSnapshot<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for ExecutorSnapshot<'a>

§

impl<'a> !UnwindSafe for ExecutorSnapshot<'a>

§

impl<'a> Forget for ExecutorSnapshot<'a>

§

impl<'a> Freeze for ExecutorSnapshot<'a>

§

impl<'a> Move for ExecutorSnapshot<'a>

§

impl<'a> Send for ExecutorSnapshot<'a>

§

impl<'a> Sync for ExecutorSnapshot<'a>

§

impl<'a> Unpin for ExecutorSnapshot<'a>

§

impl<'a> UnsafeUnpin for ExecutorSnapshot<'a>

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