Skip to main content

LocalRuntimeQueues

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>

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

选择默认定时任务队列(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>>

选择定时构造回调(callback)。构造时使用本次实际运行时编号(RuntimeId)、时钟(clock) 和线程通知句柄(ThreadNotifier)准备定时来源。定时和空闲选择可按任意顺序设置。

Trait Implementations§

§

impl Default for LocalRuntimeQueues

§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<I, F> Forget for LocalRuntimeQueues<I, F>

§

impl<I, F> Freeze for LocalRuntimeQueues<I, F>
where I: Freeze, F: Freeze,

§

impl<I, F> Move for LocalRuntimeQueues<I, F>

§

impl<I, F> RefUnwindSafe for LocalRuntimeQueues<I, F>

§

impl<I, F> Send for LocalRuntimeQueues<I, F>
where F: Send, I: Send,

§

impl<I, F> Sync for LocalRuntimeQueues<I, F>
where F: Sync, I: Sync,

§

impl<I, F> Unpin for LocalRuntimeQueues<I, F>
where F: Unpin, I: Unpin,

§

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