pub struct Event<T> { /* private fields */ }Expand description
A scheduled event stored in the wheel.
Event values are returned by read/pop/remove operations.
They carry metadata used by the wheel scheduler:
tick: absolute tick when the event can be processed.delta_tick: wave index within the sametick.
§Example
use okee_wheel_timer::HashedWheelTimer;
let mut wheel = HashedWheelTimer::new(8);
let id = wheel.schedule(0, "payload").id;
let events = wheel.pop_events();
assert_eq!(events[0].id(), id);
assert_eq!(events[0].tick(), 0);
assert_eq!(events[0].data(), &"payload");Implementations§
Trait Implementations§
impl<T: Copy> Copy for Event<T>
Auto Trait Implementations§
impl<T> Freeze for Event<T>where
T: Freeze,
impl<T> RefUnwindSafe for Event<T>where
T: RefUnwindSafe,
impl<T> Send for Event<T>where
T: Send,
impl<T> Sync for Event<T>where
T: Sync,
impl<T> Unpin for Event<T>where
T: Unpin,
impl<T> UnwindSafe for Event<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more