Struct MpscIdleTaskQueueHandle
pub struct MpscIdleTaskQueueHandle { /* private fields */ }Expand description
同一来源的Clone+Send+Sync透明访问;不具有全量clear/close权限。
取消检查不判断空闲,不保证立即检查到任意位置;已有原值与数量始终由来源负责。
Trait Implementations§
§impl Clone for MpscIdleTaskQueueHandle
impl Clone for MpscIdleTaskQueueHandle
§impl IdleTaskQueue for MpscIdleTaskQueueHandle
impl IdleTaskQueue for MpscIdleTaskQueueHandle
§fn try_push(&self, task: Runnable) -> RawResult<(), IdleSubmitError>
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 try_take_batch( &self, max_tasks: NonZeroUsize, ) -> RawResult<IdleTake, IdleQueueError>
一次有限获取;不因有内容而自行断言空闲。返回量非零且不超过本次上限。
§fn process_cleanup(&self) -> Result<QueueCleanupProgress>
fn process_cleanup(&self) -> Result<QueueCleanupProgress>
有限检查取消或继续已开始的管理清理;未取消项可被旋转到队尾,数量不变。 当前范围未完为MoreWork,但不据此要求外层无休眠地空转。 开放Clear已完成内部清理时可返回Complete,保留终点供原管理调用最终确认。
§fn process_cleanup_with_readiness(&self) -> Result<(QueueCleanupProgress, bool)>
fn process_cleanup_with_readiness(&self) -> Result<(QueueCleanupProgress, bool)>
有限推进一次清理,并返回本线程可继续推进的事实,供调用者决定是否休眠。 Read more
§fn status(&self) -> IdleQueueStatus
fn status(&self) -> IdleQueueStatus
查询本来源单向变化的状态快照(snapshot),不推进业务或清理。
不承诺与另一次数量读取对应同一瞬间。
Auto Trait Implementations§
impl !RefUnwindSafe for MpscIdleTaskQueueHandle
impl !UnwindSafe for MpscIdleTaskQueueHandle
impl Forget for MpscIdleTaskQueueHandle
impl Freeze for MpscIdleTaskQueueHandle
impl Move for MpscIdleTaskQueueHandle
impl Send for MpscIdleTaskQueueHandle
impl Sync for MpscIdleTaskQueueHandle
impl Unpin for MpscIdleTaskQueueHandle
impl UnsafeUnpin for MpscIdleTaskQueueHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more