TimerDequeTicketIssuer

Struct TimerDequeTicketIssuer 

Source
pub struct TimerDequeTicketIssuer<MODE>{ /* private fields */ }
Expand description

A type of deque which issues a tickets TimerDequeTicket which contains a TimerDequeId - a uniq number of the ticket. On timeout, the TimerDequeId is returned to indentify the timeout source.

§Generics

MODE - a OrderedTimerDequeMode defines the deque behaviour. There are two types of the operation:

  • After timeout the element is removed from the queue.

  • After timeout the element timeout is extended automatically until the item removed from the queue manually.

§Examples

let mut time_list = 
    OrderedTimerDeque
        ::<DequeOnce, TimerDequeTicketIssuer<_>>
        ::new("test_label1".into(), 4, false, true)
           .unwrap();

or

let mut time_list = 
    OrderedTimerDeque
        ::<DequePeriodic, TimerDequeTicketIssuer<_>>
        ::new("test_label1".into(), 4, false, true)
           .unwrap();

Trait Implementations§

Source§

impl<MODE> Debug for TimerDequeTicketIssuer<MODE>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<MODE: OrderedTimerDequeMode> Display for TimerDequeTicketIssuer<MODE>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<MODE: OrderedTimerDequeMode> Ord for TimerDequeTicketIssuer<MODE>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<MODE> OrderedTimerDequeHandle<MODE> for TimerDequeTicketIssuer<MODE>

Source§

type TimerId = TimerDequeId

Input item.

Source§

type HandleRes = Vec<<TimerDequeTicketIssuer<MODE> as OrderedTimerDequeHandle<MODE>>::TimerId>

A collection which is used to collect the items which are removed from the queue due to timeout.
Source§

fn handle( self, timer_self: &mut OrderTimerDeque<MODE, Self>, timer_ids: &mut Self::HandleRes, ) -> TimerResult<()>

A spefic code which is called during timeout routine handling. Normally is should store the result into the collection and reschedule the item if it is repeated.
Source§

fn is_same(&self, other: &Self::TimerId) -> bool

Matches the current instance with provided other instances OrderedTimerDequeHandle::TimerId. But, the PartialEq<Self::TimerId> is implemented, so the == can be used to compare.
Source§

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

Postpones the timeout of the current instance. The postp_time is a RelativeTime i.e inroduces the offset.
Source§

fn resched(&mut self, time: MODE) -> TimerResult<()>

Reschedules the current instance. This is different from the postpone as the instance is assagned with a new time. The MODE cannot be changed, only time.
Source§

fn into_timer_id(self) -> Option<Self::TimerId>

Attempts to acquire the OrderedTimerDequeHandle::TimerId by consuming the instance.
Source§

impl<MODE> OrderedTimerDequeInterf<MODE> for TimerDequeTicketIssuer<MODE>

Source§

fn get_timeout_absolute(&self) -> AbsoluteTime

Returns the absolute time and the timer mode.
Source§

impl<MODE: OrderedTimerDequeMode> PartialEq<TimerDequeId> for TimerDequeTicketIssuer<MODE>

Source§

fn eq(&self, other: &TimerDequeId) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<MODE: OrderedTimerDequeMode> PartialEq<TimerDequeTicket> for TimerDequeTicketIssuer<MODE>

Source§

fn eq(&self, other: &TimerDequeTicket) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<MODE: OrderedTimerDequeMode> PartialEq<TimerDequeTicketIssuer<MODE>> for TimerDequeTicket

Source§

fn eq(&self, other: &TimerDequeTicketIssuer<MODE>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<MODE: OrderedTimerDequeMode> PartialEq for TimerDequeTicketIssuer<MODE>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<MODE: OrderedTimerDequeMode> PartialOrd for TimerDequeTicketIssuer<MODE>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<MODE: OrderedTimerDequeMode> Eq for TimerDequeTicketIssuer<MODE>

Auto Trait Implementations§

§

impl<MODE> Freeze for TimerDequeTicketIssuer<MODE>
where MODE: Freeze,

§

impl<MODE> RefUnwindSafe for TimerDequeTicketIssuer<MODE>
where MODE: RefUnwindSafe,

§

impl<MODE> Send for TimerDequeTicketIssuer<MODE>
where MODE: Send,

§

impl<MODE> Sync for TimerDequeTicketIssuer<MODE>
where MODE: Sync,

§

impl<MODE> Unpin for TimerDequeTicketIssuer<MODE>
where MODE: Unpin,

§

impl<MODE> UnwindSafe for TimerDequeTicketIssuer<MODE>
where MODE: UnwindSafe,

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> 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V