Struct LocalRuntimeQueues
pub struct LocalRuntimeQueues<I = NoIdleQueue, F = NoTimerQueue<GlobalManualInstant>> { /* private fields */ }Expand description
单线程本地运行时(single-threaded local runtime)的定时任务队列(timer task queue)
和空闲任务队列(idle task queue)配置。默认两项均省略,可独立选配。
普通和内部任务队列仍共用该运行时拥有的同一份 TaskQueue。
Implementations§
§impl<I, F> LocalRuntimeQueues<I, F>
impl<I, F> LocalRuntimeQueues<I, F>
pub fn with_idle<Q: IdleQueueManager>(self, idle: Q) -> LocalRuntimeQueues<Q, F>
pub fn with_idle<Q: IdleQueueManager>(self, idle: Q) -> LocalRuntimeQueues<Q, F>
按值移交空闲任务队列(idle task queue)的管理者。保留原定时选择。 移交前已取得的共享句柄(shared handle)继续指向原空闲任务队列。
pub fn with_default_timer(
self,
) -> LocalRuntimeQueues<I, MakeDefaultTimer<ManualClock>>
pub fn with_default_timer( self, ) -> LocalRuntimeQueues<I, MakeDefaultTimer<ManualClock>>
选择默认定时任务队列(timer task queue)。在构造运行时(runtime)前安装全局时钟(global clock)。
pub fn with_timer<T, G>(
self,
make: G,
) -> LocalRuntimeQueues<I, impl FnOnce(RuntimeId, &ManualClock, ThreadNotifier, CancelTimerOptions) -> Result<T>>where
T: ExecutorTimer<Instant = GlobalManualInstant> + 'static,
G: FnOnce(RuntimeId, &ManualClock, ThreadNotifier) -> Result<T>,
pub fn with_timer<T, G>(
self,
make: G,
) -> LocalRuntimeQueues<I, impl FnOnce(RuntimeId, &ManualClock, ThreadNotifier, CancelTimerOptions) -> Result<T>>where
T: ExecutorTimer<Instant = GlobalManualInstant> + 'static,
G: FnOnce(RuntimeId, &ManualClock, ThreadNotifier) -> Result<T>,
选择定时构造回调(callback)。构造时使用本次实际运行时编号(RuntimeId)、时钟(clock) 和线程通知句柄(ThreadNotifier)准备定时来源。定时和空闲选择可按任意顺序设置。
Trait Implementations§
Auto Trait Implementations§
impl<I, F> Forget for LocalRuntimeQueues<I, F>
impl<I, F> Freeze for LocalRuntimeQueues<I, F>
impl<I, F> Move for LocalRuntimeQueues<I, F>
impl<I, F> RefUnwindSafe for LocalRuntimeQueues<I, F>where
I: RefUnwindSafe,
F: RefUnwindSafe,
impl<I, F> Send for LocalRuntimeQueues<I, F>
impl<I, F> Sync for LocalRuntimeQueues<I, F>
impl<I, F> Unpin for LocalRuntimeQueues<I, F>
impl<I, F> UnsafeUnpin for LocalRuntimeQueues<I, F>where
I: UnsafeUnpin,
F: UnsafeUnpin,
impl<I, F> UnwindSafe for LocalRuntimeQueues<I, F>where
I: UnwindSafe,
F: UnwindSafe,
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