[][src]Struct queen::timer::wheel::Wheel

pub struct Wheel<E> where
    E: Debug
{ /* fields omitted */ }

An implementation of four-level byte-sized wheel

Implementations

impl<E> Wheel<E> where
    E: Debug
[src]

pub fn new(pruner: fn(_: &E) -> bool) -> Self[src]

Create a new wheel

pub fn remaining(&self) -> u32[src]

Described how many ticks are left before the timer has wrapped around completely

pub fn current(&self) -> u32[src]

Produces a 32-bit timestamp including the current index of every wheel

pub fn insert(&mut self, e: E, delay: u32) -> Result<(), E>[src]

Insert a new timeout into the wheel to be returned after delay ticks

pub fn tick(&mut self) -> Vec<E>[src]

Move the wheel forward by a single unit

Returns a list of all timers that expire during this tick.

pub fn skip(&mut self, amount: u32)[src]

Skip a certain amount of units

No timers will be executed for the skipped time. Only use this after determining that it's actually valid with can_skip!

pub fn can_skip(&self) -> Option<u32>[src]

Determine if and how many ticks can be skipped

Trait Implementations

impl<E> Default for Wheel<E> where
    E: Debug
[src]

Auto Trait Implementations

impl<E> RefUnwindSafe for Wheel<E> where
    E: RefUnwindSafe

impl<E> Send for Wheel<E> where
    E: Send

impl<E> Sync for Wheel<E> where
    E: Sync

impl<E> Unpin for Wheel<E> where
    E: Unpin

impl<E> UnwindSafe for Wheel<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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