Skip to main content

RuntimeQueues

Struct RuntimeQueues 

pub struct RuntimeQueues<C: ExecutorClock<Instant = GlobalManualInstant> = ManualClock, E = MpscTaskQueue, I = MpscIdleTaskQueue, F = MakeDefaultTimer<C>, B = DefaultInternalQueue> { /* private fields */ }
Expand description

分别选择外部任务队列(external task queue)、内部任务队列(internal task queue)、 定时任务队列(timer task queue)和空闲任务队列(idle task queue)。 缺项使用默认配置。定时和空闲可分别省略。构造运行时(runtime)时移交原实例, 由执行器(executor)绑定。独立串行运行时只接受原外部与内部组合。

Implementations§

§

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

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

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

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

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

pub fn with_internal<Q>( self, queue: Q, ) -> RuntimeQueues<C, E, I, F, impl RuntimeInternalFactory<Q>>
where Q: InternalTaskQueue + 'static,

按值移交内部任务队列(internal task queue)。

运行时构造只接管此原值,要求队列开放、为空且仅绑定当前执行器(executor)。 已绑定另一所属域(owner domain)的队列无法接入。选择已移交,构造失败时沿原释放约定。

pub fn with_internal_factory<Q, G>( self, make: G, ) -> RuntimeQueues<C, E, I, F, G>
where Q: InternalTaskQueue + 'static, G: for<'owner> FnOnce(InternalQueueContext<'owner>) -> Result<Q>,

在实际所属域(owner domain)建立后调用一次回调(callback),接管回调交出的队列。

回调持有的构造权限仅在本次调用中有效。独立串行的队列类型检查早于回调。 执行器(executor)检查实际队列后才建立定时来源,并沿原约定接管构造和关闭责任。

pub fn without_idle(self) -> RuntimeQueues<C, E, NoIdleQueue, F, B>

省略空闲任务队列(idle task queue),相应派发入口在编译期不可用。 已指定的空闲管理者在调用线程释放,其余选择保留。

pub fn without_timer( self, ) -> RuntimeQueues<C, E, I, NoTimerQueue<GlobalManualInstant>, B>

省略定时任务队列(timer task queue),相应计时、带超时等待和定时派发入口不可用。 默认构造无需安装全局时钟(clock)。原定时构造回调及其捕获值在调用线程释放, 回调不执行,其余选择保留。

pub fn with_timer<T, G>( self, make: G, ) -> RuntimeQueues<C, E, I, impl FnOnce(RuntimeId, &C, ThreadNotifier, CancelTimerOptions) -> Result<T>, B>
where T: ExecutorTimer<Instant = GlobalManualInstant> + 'static, G: 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, B> Forget for RuntimeQueues<C, E, I, F, B>

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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