Trait TimedTaskDispatch
pub trait TimedTaskDispatch: TaskDispatch + RuntimeTime {
// Required methods
fn spawn_timing_with_config<F, M>(
&self,
future: F,
delay: Duration,
config: TaskConfig<M>,
) -> RawResult<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, F::Output, M>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>, M>>
where F: Future + Send + 'static,
F::Output: Send + 'static,
M: Send + Sync + 'static;
fn spawn_timing_local_with_config<F, M>(
future: F,
delay: Duration,
config: TaskConfig<M>,
) -> RawResult<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, F::Output, M, LocalOutput>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>, M, LocalOutput>>
where F: Future + 'static,
F::Output: 'static,
M: Send + Sync + 'static;
// Provided methods
fn spawn_timing<F>(
&self,
future: F,
delay: Duration,
) -> RawResult<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, F::Output>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>>>
where F: Future + Send + 'static,
F::Output: Send + 'static { ... }
fn spawn_timing_local<F>(
future: F,
delay: Duration,
) -> RawResult<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, F::Output, (), LocalOutput>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>, (), LocalOutput>>
where F: Future + 'static,
F::Output: 'static { ... }
}Expand description
同步提交原业务任务(Task)到定时来源;不直接poll,不经普通来源绕行。
Required Methods§
fn spawn_timing_with_config<F, M>(
&self,
future: F,
delay: Duration,
config: TaskConfig<M>,
) -> RawResult<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, F::Output, M>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>, M>>
fn spawn_timing_with_config<F, M>( &self, future: F, delay: Duration, config: TaskConfig<M>, ) -> RawResult<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, F::Output, M>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>, M>>
同步固定本次截止时间并提交定时来源;准备失败保原Future,明确拒绝保原任务(Task)和结果句柄(handle)。
fn spawn_timing_local_with_config<F, M>(
future: F,
delay: Duration,
config: TaskConfig<M>,
) -> RawResult<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, F::Output, M, LocalOutput>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>, M, LocalOutput>>
fn spawn_timing_local_with_config<F, M>( future: F, delay: Duration, config: TaskConfig<M>, ) -> RawResult<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, F::Output, M, LocalOutput>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>, M, LocalOutput>>
当前原线程内同步定时派发(timed dispatch);原Future/输出不要求Send/Sync,准备和拒绝均保留原值。
Provided Methods§
fn spawn_timing<F>(
&self,
future: F,
delay: Duration,
) -> RawResult<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, F::Output>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>>>
fn spawn_timing<F>( &self, future: F, delay: Duration, ) -> RawResult<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, F::Output>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>>>
默认配置的同步定时派发(timed dispatch);零时长仍入定时来源,不直接执行。
fn spawn_timing_local<F>(
future: F,
delay: Duration,
) -> RawResult<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, F::Output, (), LocalOutput>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>, (), LocalOutput>>
fn spawn_timing_local<F>( future: F, delay: Duration, ) -> RawResult<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, F::Output, (), LocalOutput>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>, (), LocalOutput>>
默认配置的本地定时派发(timed dispatch);不跳过原所属域或定时来源。
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".