Skip to main content

RuntimeQueues

Struct RuntimeQueues 

pub struct RuntimeQueues<C: ExecutorClock<Instant = GlobalManualInstant> = ManualClock, E = MpscTaskQueue, I = MpscIdleTaskQueue, F = fn(RuntimeId, &C, ThreadNotifier, CancelTimerOptions) -> Result<DefaultTimerDriver<C, RuntimeTag<C>>>> { /* private fields */ }
Expand description

分别选择外部任务队列(external task queue)、空闲任务队列(idle task queue)和定时任务队列(timer task queue)。 缺项使用原默认。构造运行时(runtime)时移交同一实例,执行器(executor)绑定对应队列。

Implementations§

§

impl<C: ExecutorClock<Instant = GlobalManualInstant>, E, I, F> RuntimeQueues<C, E, I, F>

pub fn with_external<Q: ExternalQueueManager>( self, queue: Q, ) -> RuntimeQueues<C, Q, I, F>

移交外部任务队列(external task queue)的管理者。已有共享访问按队列原约定使用。 经运行时(runtime)派发时由运行时核对任务归属并安排通知(notification)。

pub fn with_idle<Q: IdleQueueManager>( self, queue: Q, ) -> RuntimeQueues<C, E, Q, F>

移交空闲任务队列(idle task queue)的管理者。空闲判定仍由原执行器(executor)负责。 已有共享访问按队列原约定使用,经运行时派发时由运行时负责归属和通知(notification)。

pub fn with_timer<T, B>( self, make: B, ) -> RuntimeQueues<C, E, I, impl FnOnce(RuntimeId, &C, ThreadNotifier, CancelTimerOptions) -> Result<T>>
where T: ExecutorTimer<Instant = GlobalManualInstant> + 'static, B: FnOnce(RuntimeId, &C, ThreadNotifier) -> Result<T>,

使用一次原计时构造回调准备所选实例。回调使用本次实际身份、时钟(clock)和通知状态。 回调返回的拥有者在创建线程(thread)交给原执行器。失败时保留原报告(Report)。

Trait Implementations§

§

impl<C: ExecutorClock<Instant = GlobalManualInstant>> Default for RuntimeQueues<C>

§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<C, E, I, F> Forget for RuntimeQueues<C, E, I, F>

§

impl<C, E, I, F> Freeze for RuntimeQueues<C, E, I, F>
where QueueSelection<E>: Freeze, QueueSelection<I>: Freeze, F: Freeze, PhantomData<fn() -> C>: Freeze,

§

impl<C, E, I, F> Move for RuntimeQueues<C, E, I, F>

§

impl<C, E, I, F> RefUnwindSafe for RuntimeQueues<C, E, I, F>
where QueueSelection<E>: RefUnwindSafe, QueueSelection<I>: RefUnwindSafe, F: RefUnwindSafe, PhantomData<fn() -> C>: RefUnwindSafe,

§

impl<C, E, I, F> Send for RuntimeQueues<C, E, I, F>
where F: Send, QueueSelection<E>: Send, QueueSelection<I>: Send, PhantomData<fn() -> C>: Send,

§

impl<C, E, I, F> Sync for RuntimeQueues<C, E, I, F>
where F: Sync, QueueSelection<E>: Sync, QueueSelection<I>: Sync, PhantomData<fn() -> C>: Sync,

§

impl<C, E, I, F> Unpin for RuntimeQueues<C, E, I, F>
where F: Unpin, QueueSelection<E>: Unpin, QueueSelection<I>: Unpin, PhantomData<fn() -> C>: Unpin,

§

impl<C, E, I, F> UnsafeUnpin for RuntimeQueues<C, E, I, F>
where QueueSelection<E>: UnsafeUnpin, QueueSelection<I>: UnsafeUnpin, F: UnsafeUnpin, PhantomData<fn() -> C>: UnsafeUnpin,

§

impl<C, E, I, F> UnwindSafe for RuntimeQueues<C, E, I, F>
where QueueSelection<E>: UnwindSafe, QueueSelection<I>: UnwindSafe, F: UnwindSafe, PhantomData<fn() -> C>: 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.