hierarchical_hash_wheel_timer 1.4.0

A low-level timer implementation using a hierarchical four-level hash wheel with overflow.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::IdOnlyTimerEntry;
use std::time::Duration;
use uuid::Uuid;

/// A shorthand for id timer entries that use [Uuid](uuid::Uuid) as their id type
pub type UuidOnlyTimerEntry = IdOnlyTimerEntry<Uuid>;

impl UuidOnlyTimerEntry {
    /// Produce an entry with a random [Uuid] and the given `delay`
    ///
    /// Uses `Uuid::new_v4()` internally.
    pub fn with_random_id(delay: Duration) -> Self {
        Self::new(Uuid::new_v4(), delay)
    }
}