OrderedTimerDequeMode

Trait OrderedTimerDequeMode 

Source
pub trait OrderedTimerDequeMode:
    Debug
    + Display
    + Ord
    + PartialOrd
    + Eq
    + PartialEq {
    const IS_ONCE: bool;

    // Required methods
    fn validate_time(&self, cmp: AbsoluteTime) -> TimerResult<()>;
    fn get_absolut_timeout(&self) -> AbsoluteTime;
    fn postpone(&mut self, posp_time: RelativeTime) -> TimerResult<()>;

    // Provided method
    fn advance_timeout(&mut self) { ... }
}
Expand description

A trait which is implemented by the structs which define the operation mode of the deque.

At the moment for: DequeOnce and DequePeriodic.

Required Associated Constants§

Source

const IS_ONCE: bool

A type of operation. If the item deques once, then this value should be true. Otherwise, it is periodic.

Required Methods§

Source

fn validate_time(&self, cmp: AbsoluteTime) -> TimerResult<()>

Checks the current instance against the provided cmp AbsoluteTime. It is expected that the current instance’s timeout value is actual and haven’t outlive the cmp already. if it does the error: TimerErrorType::Expired should be returned. Or any other error if it is required.

Source

fn get_absolut_timeout(&self) -> AbsoluteTime

Returns the absolute timeout for the instance of the deque.

Source

fn postpone(&mut self, posp_time: RelativeTime) -> TimerResult<()>

Postpones the time by the relative offset post_time. May return error (if required) if the absolut timeout value overflows.

May return TimerErrorType::TicketInstanceGone if ticket was invalidated.

Provided Methods§

Source

fn advance_timeout(&mut self)

Updates the timeout when the deque works in periodic mode. By fedault it does nothing.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§