Skip to main content

ExecutorState

Struct ExecutorState 

pub struct ExecutorState { /* private fields */ }
Expand description

实现者共享的控制与必要数量;业务仅经运行时(runtime)只读接口访问。

Implementations§

§

impl ExecutorState

pub fn push_back( &self, queue: &mut TaskQueue, task: Runnable, ) -> RawResult<(), QueuePushError>

新的本地入队一次计入internal;拒绝/展开归还预留,原值由具体队列接口返还。 已经从共享返回交付的原值不能重复调用;其数量随原持有转移。

pub fn push_front( &self, queue: &mut TaskQueue, task: Runnable, ) -> RawResult<(), QueuePushError>

与push_back相同记账,只影响下一次队首选择,不抢断当前轮询(poll)。

pub fn new() -> Self

创建Open、关闭未请求、未推进、最近空闲Unknown且内部/在途数量均零的控制对象。 不分配队列(queue)、任务(Task)或线程(thread)。

pub fn status(&self) -> RuntimeStatus

pub fn close_state(&self) -> CloseState

pub fn is_driving(&self) -> bool

读取原服务排他推进权是否被持有,包含线程停放与同步钩子(hook)。 共享句柄(shared handle)只推进独立根异步计算(Future)的block_on不计入。

pub fn last_idle_state(&self) -> IdleState

pub fn request_close(&self, notifier: &ThreadNotifier) -> CloseRequestStatus

同步记录关闭请求,并通过同一服务的线程通知(thread notification)安排必要检查。 首次返回Requested、重复返回AlreadyRequested、服务已不可用返回AlreadyClosed。 不等待清理,不在此关闭来源或析构(drop)业务;请求结果不等于CloseState::Completed。

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.