Skip to main content

TimedTaskNotifier

Struct TimedTaskNotifier 

Source
pub struct TimedTaskNotifier<N: TaskNotifier, A: TimerAccess> { /* private fields */ }
Expand description

同一原任务(Task)的通知与定时登记关联,不持有另一份执行权限。 普通notify只转发线程通知(thread notification);取消通知依据已记录的原生取消安排定时取消。 克隆(Clone)只保同一登记和原目标,不创建任务、登记或新截止时间。

Implementations§

Source§

impl<N: TaskNotifier, A: TimerAccess> TimedTaskNotifier<N, A>

Source

pub fn new(inner: N, access: A, registration: A::Registration) -> Self

组合原通知、同服务计时访问及该任务(Task)的原登记;调用者须保持它们属于同一原目标。 构造只接管这些能力,不提交、取消或轮询(poll)任务。

Trait Implementations§

Source§

impl<N: TaskNotifier, A: TimerAccess> Clone for TimedTaskNotifier<N, A>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N: TaskNotifier, A: TimerAccess> QueueNotifier for TimedTaskNotifier<N, A>

Source§

fn notify(&self)

同步安排一次后续检查;不得等待业务、队列(queue)内容或其它线程(thread)。
Source§

impl<N: TaskNotifier, A: TimerAccess> TaskNotifier for TimedTaskNotifier<N, A>

Source§

fn notify_cancel(&self, snapshot: impl FnOnce() -> TaskSnapshot)

安排取消事实之后的必要检查;普通实现不求值snapshot,定时实现只依据原生Recorded事实。

Auto Trait Implementations§

§

impl<N, A> Forget for TimedTaskNotifier<N, A>

§

impl<N, A> Freeze for TimedTaskNotifier<N, A>
where N: Freeze, A: Freeze, <A as TimerAccess>::Registration: Freeze,

§

impl<N, A> Move for TimedTaskNotifier<N, A>

§

impl<N, A> RefUnwindSafe for TimedTaskNotifier<N, A>

§

impl<N, A> Send for TimedTaskNotifier<N, A>
where <A as TimerAccess>::Registration: Send,

§

impl<N, A> Sync for TimedTaskNotifier<N, A>
where <A as TimerAccess>::Registration: Sync,

§

impl<N, A> Unpin for TimedTaskNotifier<N, A>
where N: Unpin, A: Unpin, <A as TimerAccess>::Registration: Unpin,

§

impl<N, A> UnsafeUnpin for TimedTaskNotifier<N, A>

§

impl<N, A> UnwindSafe for TimedTaskNotifier<N, A>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.