Skip to main content

Wheel

Struct Wheel 

pub struct Wheel<K> { /* private fields */ }

Implementations§

§

impl<K: Copy> Wheel<K>

pub fn new(now_ms: u64) -> Self

pub fn len(&self) -> usize

pub fn is_empty(&self) -> bool

pub fn elapsed(&self) -> u64

pub fn insert(&mut self, when_ms: u64, key: K)

pub fn next_wake(&self) -> Option<u64>

When poll should next be called, if any timer is pending.

pub fn poll(&mut self, now_ms: u64, out: &mut Vec<K>)

Advances to now_ms and appends every entry due by then to out.

Auto Trait Implementations§

§

impl<K> Forget for Wheel<K>

§

impl<K> Freeze for Wheel<K>
where Vec<Level<K>>: Freeze, BTreeMap<u64, Vec<K>>: Freeze, Vec<K>: Freeze,

§

impl<K> Move for Wheel<K>

§

impl<K> RefUnwindSafe for Wheel<K>

§

impl<K> Send for Wheel<K>
where Vec<Level<K>>: Send, BTreeMap<u64, Vec<K>>: Send, Vec<K>: Send,

§

impl<K> Sync for Wheel<K>
where Vec<Level<K>>: Sync, BTreeMap<u64, Vec<K>>: Sync, Vec<K>: Sync,

§

impl<K> Unpin for Wheel<K>
where Vec<Level<K>>: Unpin, BTreeMap<u64, Vec<K>>: Unpin, Vec<K>: Unpin,

§

impl<K> UnsafeUnpin for Wheel<K>
where Vec<Level<K>>: UnsafeUnpin, BTreeMap<u64, Vec<K>>: UnsafeUnpin, Vec<K>: UnsafeUnpin,

§

impl<K> UnwindSafe for Wheel<K>
where Vec<Level<K>>: UnwindSafe, BTreeMap<u64, Vec<K>>: UnwindSafe, Vec<K>: 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, 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.