Skip to main content

MpscIdleTaskQueueHandle

Struct MpscIdleTaskQueueHandle 

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

同一来源的Clone+Send+Sync透明访问;不具有全量clear/close权限。

取消检查不判断空闲,不保证立即检查到任意位置;已有原值与数量始终由来源负责。

Trait Implementations§

§

impl Clone for MpscIdleTaskQueueHandle

§

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
§

impl IdleTaskQueue for MpscIdleTaskQueueHandle

§

fn try_push(&self, task: Runnable) -> RawResult<(), IdleSubmitError>

明确拒绝返回同一原Runnable;缺MPSC链接为Backend中的InvalidInput,不提前drop原值。

§

fn try_take_batch( &self, max_tasks: NonZeroUsize, ) -> RawResult<IdleTake, IdleQueueError>

一次有限获取;不因有内容而自行断言空闲。返回量非零且不超过本次上限。

§

fn process_cleanup(&self) -> Result<QueueCleanupProgress>

有限检查取消或继续已开始的管理清理;未取消项可被旋转到队尾,数量不变。 当前范围未完为MoreWork,但不据此要求外层无休眠地空转。 开放Clear已完成内部清理时可返回Complete,保留终点供原管理调用最终确认。

§

fn process_cleanup_with_readiness(&self) -> Result<(QueueCleanupProgress, bool)>

有限推进一次清理,并返回本线程可继续推进的事实,供调用者决定是否休眠。 Read more
§

fn status(&self) -> IdleQueueStatus

查询本来源单向变化的状态快照(snapshot),不推进业务或清理。 不承诺与另一次数量读取对应同一瞬间。
§

fn len(&self) -> usize

安全查询已接收但尚未交付或实际清理的任务(Task)数量。 Read more
§

fn is_empty(&self) -> bool

按len相同口径查询当次是否为零,不等待稳定,不证明来源关闭完成。

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