TimerDequeueSignal

Trait TimerDequeueSignal 

Source
pub trait TimerDequeueSignal {
    type TimerQueueID: Eq + PartialEq + Display + Debug;
    type TimeoutErr: Display + Debug;

    // Required method
    fn get_id(&self) -> Self::TimerQueueID;

    // Provided methods
    fn sig_timeout(self) -> Result<(), Self::TimeoutErr>
       where Self: Sized { ... }
    async fn a_sig_timeout(self) -> Result<(), Self::TimeoutErr>
       where Self: Sized { ... }
}
Expand description

A trait which should be implemented on the struct which will be provided to timer dequeue. The trait implements the uniqid and signalling. There are two realizations: sig_timeout for sync and a_sig_timeout for async. Both functions must use any methods to send signal but it must never block the thread!

Required Associated Types§

Source

type TimerQueueID: Eq + PartialEq + Display + Debug

A uniq id type. It is used to identify the instance.

Source

type TimeoutErr: Display + Debug

Error type returned by the signal functions.

Required Methods§

Source

fn get_id(&self) -> Self::TimerQueueID

This function should return the uniq id of the instance.

Provided Methods§

Source

fn sig_timeout(self) -> Result<(), Self::TimeoutErr>
where Self: Sized,

This function should notify i.e send signal or whatever. The important condition is not to block the thread.

Source

async fn a_sig_timeout(self) -> Result<(), Self::TimeoutErr>
where Self: Sized,

This function should notify i.e send signal or whatever. The important condition is not to block the thread.

Implementors§