pub struct ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,{ /* private fields */ }Expand description
一份固定线程服务,不可Send/Sync;不创建或接管外部线程的所有权。 常规使用SerialRuntime/ConcurrentRuntime,无需填写内部参数;定制类型由with_components推导。 释放(drop)先撤本地权限,再按原执行器(executor)及任务域约定实际退出。 正在进行的同步活动可延迟实际本地清理,不等待普通共享句柄(shared handle)全部释放。 关闭请求、服务不可用与成功完成分别观察,清理失败不能报CloseState::Completed。 waiting_for_wake_count及pending_cancel_task_count沿默认执行器按需O(n)扫描登记,n为登记规模; 封装不把这两项查询转为固定成本,默认推进不主动采集。
Implementations§
Source§impl<M, C, P, H> ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
Sourcepub fn submit_local_front(task: UnsubmittedTask) -> RawResult<(), SubmitError>
pub fn submit_local_front(task: UnsubmittedTask) -> RawResult<(), SubmitError>
由当前原线程把首次提交放内部头;无本地权限时返原值及原因。
Sourcepub fn spawn_local_front_with_config<F, V>(
future: F,
config: TaskConfig<V>,
) -> RawResult<LocalTaskHandle<F::Output, V>, SpawnError<F, ThreadNotifier, V, LocalOutput>>
pub fn spawn_local_front_with_config<F, V>( future: F, config: TaskConfig<V>, ) -> RawResult<LocalTaskHandle<F::Output, V>, SpawnError<F, ThreadNotifier, V, LocalOutput>>
本地队首便利派发;与spawn_local相同原值及权限,只改变下一次排队优先级。
Sourcepub fn spawn_local_front<F>(
future: F,
) -> RawResult<LocalTaskHandle<F::Output>, SpawnError<F, ThreadNotifier, (), LocalOutput>>
pub fn spawn_local_front<F>( future: F, ) -> RawResult<LocalTaskHandle<F::Output>, SpawnError<F, ThreadNotifier, (), LocalOutput>>
默认附加数据(metadata)的本地队首入口,不增加F的Send/Sync/Unpin。
Examples found in repository?
examples/runtime_bounds.rs (line 61)
39fn roots(runtime: &ConcurrentRuntime, handle: &Handle) {
40 let value = Rc::new(7);
41 let _: Rc<usize> = runtime.block_on(Borrowed {
42 value: &value,
43 fixed: PhantomPinned,
44 });
45 let _: Rc<usize> = handle.block_on(Borrowed {
46 value: &value,
47 fixed: PhantomPinned,
48 });
49 let _ = runtime.timeout_on(
50 Borrowed {
51 value: &value,
52 fixed: PhantomPinned,
53 },
54 std::time::Duration::from_millis(1),
55 );
56 let _ = handle.spawn(SendNotSync {
57 value: Cell::new(3),
58 fixed: PhantomPinned,
59 });
60 let _ = ConcurrentRuntime::spawn_local(async { Rc::new(1usize) });
61 let _ = ConcurrentRuntime::spawn_local_front(async { Rc::new(2usize) });
62 let _ = SerialRuntime::idle_local(async { Cell::new(4usize) });
63 let _ = handle.wait_one_timeout::<Rc<usize>>(std::time::Duration::from_secs(2));
64}Source§impl<M, C, P, H> ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
Source§impl<M: RuntimeMode> ConfiguredRuntime<M, ManualClock, DefaultIdlePolicy, NoHooks>
impl<M: RuntimeMode> ConfiguredRuntime<M, ManualClock, DefaultIdlePolicy, NoHooks>
Sourcepub fn with_options(options: RuntimeOptions) -> Result<Self>
pub fn with_options(options: RuntimeOptions) -> Result<Self>
采用指定工作额度;不改变创建线程归属,不安装全局时钟或启动线程。
Sourcepub fn with_components<C, P, H>(
clock: C,
policy: P,
hooks: H,
options: RuntimeOptions,
) -> Result<ConfiguredRuntime<M, C, P, H>>
pub fn with_components<C, P, H>( clock: C, policy: P, hooks: H, options: RuntimeOptions, ) -> Result<ConfiguredRuntime<M, C, P, H>>
由参数推导定制类型,不把内部队列泛型传播到调用点。
Examples found in repository?
examples/runtime_bounds.rs (lines 70-75)
65fn declarations(clock: ManualClock) {
66 send_sync::<Handle>();
67 capabilities::<ConcurrentRuntime>();
68 capabilities::<SerialRuntime>();
69 capabilities::<Handle>();
70 let _ = ConcurrentRuntime::with_components(
71 clock,
72 LocalPolicy(Rc::new(())),
73 LocalHooks(Rc::new(())),
74 RuntimeOptions::default(),
75 );
76}Source§impl<M, C, P, H> ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
Sourcepub fn from_components(
clock: C,
policy: P,
hooks: H,
options: RuntimeOptions,
) -> Result<Self>
pub fn from_components( clock: C, policy: P, hooks: H, options: RuntimeOptions, ) -> Result<Self>
静态替换同源时钟、空闲/休眠策略及钩子;无额外Send/Sync/Default约束强加给P/H。 模式M固定普通新业务接纳;策略不能把串行改成并发。
Sourcepub fn handle(&self) -> RuntimeHandle<C>
pub fn handle(&self) -> RuntimeHandle<C>
取得同一服务的共享访问;不移交服务推进权,也不延长本地Future的清理。
Trait Implementations§
Source§impl<M, C, P, H> Drop for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> Drop for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
Source§impl<M, C, P, H> IdleDispatch for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> IdleDispatch for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
Source§fn submit_idle(&self, task: UnsubmittedTask) -> RawResult<(), SubmitError>
fn submit_idle(&self, task: UnsubmittedTask) -> RawResult<(), SubmitError>
向同一服务的空闲来源提交普通Send任务(Task);不检查空闲、不保证未来接纳。
Source§fn idle_local_with_config<F, V>(
future: F,
config: TaskConfig<V>,
) -> RawResult<TaskHandle<F::Output, V>, SpawnError<F, ThreadNotifier, V>>
fn idle_local_with_config<F, V>( future: F, config: TaskConfig<V>, ) -> RawResult<TaskHandle<F::Output, V>, SpawnError<F, ThreadNotifier, V>>
从当前环境定位原服务后提交共享空闲来源;Future与输出要求Send,不要求Sync,不预先绑定执行线程。
Source§fn idle_with_config<F, M>(
&self,
future: F,
config: TaskConfig<M>,
) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output, M>, SpawnError<F, Self::Notifier, M>>
fn idle_with_config<F, M>( &self, future: F, config: TaskConfig<M>, ) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output, M>, SpawnError<F, Self::Notifier, M>>
创建并提交空闲时任务(idle task);成功只证明来源接受,不保证执行。
Source§fn idle<F>(
&self,
future: F,
) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output>, SpawnError<F, Self::Notifier>>
fn idle<F>( &self, future: F, ) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output>, SpawnError<F, Self::Notifier>>
默认配置的空闲提交;任务(Task)未接纳前仍可按原控制能力取消。
Source§fn idle_local<F>(
future: F,
) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output>, SpawnError<F, Self::Notifier>>
fn idle_local<F>( future: F, ) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output>, SpawnError<F, Self::Notifier>>
默认配置的当前空闲提交;输入保持Send约束,不等同spawn_local的本地非Send能力。
Source§impl<M, C, P, H> LocalTaskDispatch for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> LocalTaskDispatch for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
Source§fn create_local_with_config<F, V>(
future: F,
config: TaskConfig<V>,
) -> RawResult<(UnsubmittedTask, LocalTaskHandle<F::Output, V>), CreateError<F, V>>
fn create_local_with_config<F, V>( future: F, config: TaskConfig<V>, ) -> RawResult<(UnsubmittedTask, LocalTaskHandle<F::Output, V>), CreateError<F, V>>
通过当前有效本地权限创建;原Future与输出保持原线程清理,不要求Send/Sync/Unpin。失败返还原输入。
Source§fn submit_local(task: UnsubmittedTask) -> RawResult<(), SubmitError>
fn submit_local(task: UnsubmittedTask) -> RawResult<(), SubmitError>
仅在原所属线程(owner thread)的有效本地范围首次提交;错误返还同一待提交值。
Source§fn create_local<F>(
future: F,
) -> Result<(UnsubmittedTask, TaskHandle<Self::Notifier, <F as Future>::Output, (), LocalOutput>), CreateError<F, ()>>
fn create_local<F>( future: F, ) -> Result<(UnsubmittedTask, TaskHandle<Self::Notifier, <F as Future>::Output, (), LocalOutput>), CreateError<F, ()>>
使用默认配置进行本地创建;无合法当前环境时明确失败,不猜测目标。
Source§fn spawn_local_with_config<F, M>(
future: F,
config: TaskConfig<M>,
) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output, M, LocalOutput>, SpawnError<F, Self::Notifier, M, LocalOutput>>
fn spawn_local_with_config<F, M>( future: F, config: TaskConfig<M>, ) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output, M, LocalOutput>, SpawnError<F, Self::Notifier, M, LocalOutput>>
组合本地创建与本地提交;不把结果变为可跨线程,不将拒绝当成取消。
Source§fn spawn_local<F>(
future: F,
) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output, (), LocalOutput>, SpawnError<F, Self::Notifier, (), LocalOutput>>
fn spawn_local<F>( future: F, ) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output, (), LocalOutput>, SpawnError<F, Self::Notifier, (), LocalOutput>>
默认配置的本地快速派发(local dispatch);不创建新线程,不内联轮询(poll)。
Source§impl<M, C, P, H> RuntimeBlockOn for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> RuntimeBlockOn for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
Source§impl<M, C, P, H> RuntimeContext for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> RuntimeContext for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
type Handle = RuntimeHandle<C>
Source§fn handle(&self) -> RuntimeHandle<C>
fn handle(&self) -> RuntimeHandle<C>
取得原服务的共享句柄(shared handle);Clone不复制服务,普通释放不自动关闭。
Source§fn try_current() -> Result<Self::Handle, CurrentRuntimeAccessError>
fn try_current() -> Result<Self::Handle, CurrentRuntimeAccessError>
取得并克隆(Clone)当前所选原服务的共享句柄(shared handle),不产生本地或推进权限。
无当前目标、句柄类型(type)不匹配或线程局部存储(TLS)不可访问时返回对应错误。
有效公共选择在原服务关闭后仍可读取关闭事实,不会重新开放服务。
Source§fn try_with_current<R>(
action: impl FnOnce(&Self::Handle) -> R,
) -> Result<R, CurrentRuntimeAccessError>
fn try_with_current<R>( action: impl FnOnce(&Self::Handle) -> R, ) -> Result<R, CurrentRuntimeAccessError>
同步借用不能逃逸或跨await;公共环境关闭后仍可读原关闭事实。
Source§impl<M, C, P, H> RuntimeControl for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> RuntimeControl for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
Source§fn request_close(&self) -> CloseRequestStatus
fn request_close(&self) -> CloseRequestStatus
请求一旦记录不因通知异常回滚,无人推进也不拒绝合法请求。
Source§impl<M, C, P, H> RuntimeQuery for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> RuntimeQuery for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
Source§fn status(&self) -> RuntimeStatus
fn status(&self) -> RuntimeStatus
只读采样原服务Open/Closing/Closed;不推进服务,不保证下一次提交成功。
Source§fn is_driving(&self) -> bool
fn is_driving(&self) -> bool
查询原服务推进权当前是否实际持有;包括停放与同步钩子(hook),根专用推进不计入。
Source§fn last_idle_state(&self) -> IdleState
fn last_idle_state(&self) -> IdleState
读取最近一次成功策略判断的Unknown/Idle/NotIdle,不重新调用策略。
Source§fn close_state(&self) -> CloseState
fn close_state(&self) -> CloseState
读取自洽的关闭进度样本;Completed不代表最后共享存储已释放。
Source§fn external_task_count(&self) -> usize
fn external_task_count(&self) -> usize
读取已被本外部来源接收、尚未交付或合法清理的数量;与其它项独立取样。
Source§fn internal_task_count(&self) -> usize
fn internal_task_count(&self) -> usize
读取原内部可执行来源的数量样本;不包括纯挂起任务(Task)。
Source§fn timer_registration_count(&self) -> usize
fn timer_registration_count(&self) -> usize
包括纯计时信号,不把每项都称为业务任务(Task)。
Source§fn idle_task_count(&self) -> usize
fn idle_task_count(&self) -> usize
读取空闲来源尚保管的原任务(Task)数量;不调用空闲策略。
Source§fn in_flight_task_count(&self) -> usize
fn in_flight_task_count(&self) -> usize
读取已接纳且自身退出责任未结束的任务(Task)数量;不以队列数相减推导。
Source§fn waiting_for_wake_count(&self) -> usize
fn waiting_for_wake_count(&self) -> usize
仅已接纳、根Pending交接完成且无唤醒/取消/退出需求者。
查询成本由具体实现公开,不承诺所有实现O(1);默认执行器(executor)实现按需O(n)扫描登记。
Source§fn pending_cancel_task_count(&self) -> usize
fn pending_cancel_task_count(&self) -> usize
原取消已记录但最终控制结果尚未确定;重复请求不重复计数。
查询成本由具体实现公开;默认执行器(executor)实现按需O(n)扫描,默认事件循环(event loop)不主动采集。
Source§impl<M, C, P, H> RuntimeTime for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> RuntimeTime for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
type Timer = DefaultTimerAccess<C, RuntimeTag<C>>
Source§fn timeout(&self, duration: Duration) -> Timeout<Self::Timer> ⓘ
fn timeout(&self, duration: Duration) -> Timeout<Self::Timer> ⓘ
准备惰性计时等待;正时长首次poll才取时登记,至少1ms;零时长让出一次且不可取消。
Source§impl<M, C, P, H> RuntimeWait for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> RuntimeWait for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
Source§fn wait_one_timeout<T>(
&self,
duration: Duration,
) -> (WaitOneTimeout<Self::Timer, T>, OneSender<T>)
fn wait_one_timeout<T>( &self, duration: Duration, ) -> (WaitOneTimeout<Self::Timer, T>, OneSender<T>)
返回一次交值等待与原单发送者;通过timeout_on组合,不新增T的Send/Sync/’static/Unpin约束。
Source§fn wait_any_timeout<T>(
&self,
duration: Duration,
) -> (WaitAnyTimeout<Self::Timer, T>, AnySender<T>)
fn wait_any_timeout<T>( &self, duration: Duration, ) -> (WaitAnyTimeout<Self::Timer, T>, AnySender<T>)
返回并发竞争一次交值的等待与可克隆发送者;保留原胜者及关闭错误语义。
Source§fn wait_all_timeout<T>(
&self,
duration: Duration,
) -> (WaitAllTimeout<Self::Timer, T>, AllSender<T>)
fn wait_all_timeout<T>( &self, duration: Duration, ) -> (WaitAllTimeout<Self::Timer, T>, AllSender<T>)
返回全部交值等待与原登记发送者;正常返回完整有序向量,超时不交部分结果。
Source§impl<M, C, P, H> TaskDispatch for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> TaskDispatch for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
type Notifier = ThreadNotifier
Source§fn create_with_config<F, V>(
&self,
future: F,
config: TaskConfig<V>,
) -> RawResult<(UnsubmittedTask, TaskHandle<F::Output, V>), CreateError<F, V>>
fn create_with_config<F, V>( &self, future: F, config: TaskConfig<V>, ) -> RawResult<(UnsubmittedTask, TaskHandle<F::Output, V>), CreateError<F, V>>
创建原服务的可跨线程任务(Task)并保留配置;不提交、不接纳、不轮询(poll)。失败返还原Future和配置。
Source§fn submit(&self, task: UnsubmittedTask) -> RawResult<(), SubmitError>
fn submit(&self, task: UnsubmittedTask) -> RawResult<(), SubmitError>
向创建它的原服务提交唯一原值;明确拒绝返还原持有及原因,不取消、不改线程归属。
Source§fn create<F>(
&self,
future: F,
) -> Result<(UnsubmittedTask, TaskHandle<Self::Notifier, <F as Future>::Output>), CreateError<F, ()>>
fn create<F>( &self, future: F, ) -> Result<(UnsubmittedTask, TaskHandle<Self::Notifier, <F as Future>::Output>), CreateError<F, ()>>
使用默认配置创建;返回唯一待提交值与结果句柄(handle),不隐式派发。
Source§fn spawn_with_config<F, M>(
&self,
future: F,
config: TaskConfig<M>,
) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output, M>, SpawnError<F, Self::Notifier, M>>
fn spawn_with_config<F, M>( &self, future: F, config: TaskConfig<M>, ) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output, M>, SpawnError<F, Self::Notifier, M>>
组合一次创建与提交;错误按创建/提交阶段保留对应原值,成功不表示已经执行。
Source§impl<M, C, P, H> TimedTaskDispatch for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
impl<M, C, P, H> TimedTaskDispatch for ConfiguredRuntime<M, C, P, H>where
M: RuntimeMode,
C: ExecutorClock<Instant = GlobalManualInstant>,
P: IdlePolicy,
H: ExecutorHooks,
Source§fn spawn_timing_with_config<F, V>(
&self,
future: F,
delay: Duration,
config: TaskConfig<V>,
) -> RawResult<TimedTaskHandle<F::Output, V, C>, SpawnError<F, TimedTaskNotifier<C>, V>>
fn spawn_timing_with_config<F, V>( &self, future: F, delay: Duration, config: TaskConfig<V>, ) -> RawResult<TimedTaskHandle<F::Output, V, C>, SpawnError<F, TimedTaskNotifier<C>, V>>
同步固定本次截止时间并提交定时来源;准备失败保原Future,明确拒绝保原任务(Task)和结果句柄(handle)。
Source§fn spawn_timing_local_with_config<F, V>(
future: F,
delay: Duration,
config: TaskConfig<V>,
) -> RawResult<TaskHandle<TimedTaskNotifier<C>, F::Output, V, LocalOutput>, SpawnError<F, TimedTaskNotifier<C>, V, LocalOutput>>
fn spawn_timing_local_with_config<F, V>( future: F, delay: Duration, config: TaskConfig<V>, ) -> RawResult<TaskHandle<TimedTaskNotifier<C>, F::Output, V, LocalOutput>, SpawnError<F, TimedTaskNotifier<C>, V, LocalOutput>>
当前原线程内同步定时派发(timed dispatch);原Future/输出不要求Send/Sync,准备和拒绝均保留原值。
Source§fn spawn_timing<F>(
&self,
future: F,
delay: Duration,
) -> Result<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, <F as Future>::Output>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>>>
fn spawn_timing<F>( &self, future: F, delay: Duration, ) -> Result<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, <F as Future>::Output>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>>>
默认配置的同步定时派发(timed dispatch);零时长仍入定时来源,不直接执行。
Source§fn spawn_timing_local<F>(
future: F,
delay: Duration,
) -> Result<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, <F as Future>::Output, (), LocalOutput>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>, (), LocalOutput>>
fn spawn_timing_local<F>( future: F, delay: Duration, ) -> Result<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, <F as Future>::Output, (), LocalOutput>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>, (), LocalOutput>>
默认配置的本地定时派发(timed dispatch);不跳过原所属域或定时来源。
Auto Trait Implementations§
impl<M, C, P, H> !Freeze for ConfiguredRuntime<M, C, P, H>
impl<M, C, P, H> !RefUnwindSafe for ConfiguredRuntime<M, C, P, H>
impl<M, C, P, H> !Send for ConfiguredRuntime<M, C, P, H>
impl<M, C, P, H> !Sync for ConfiguredRuntime<M, C, P, H>
impl<M, C, P, H> !UnwindSafe for ConfiguredRuntime<M, C, P, H>
impl<M, C, P, H> Forget for ConfiguredRuntime<M, C, P, H>
impl<M, C, P, H> Move for ConfiguredRuntime<M, C, P, H>
impl<M, C, P, H> Unpin for ConfiguredRuntime<M, C, P, H>
impl<M, C, P, H> UnsafeUnpin for ConfiguredRuntime<M, C, P, H>
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