pub struct TimeQ<const SLOTS: usize = 4> { /* private fields */ }
Expand description
A time ordered queue of Messages
Implementations§
Source§impl<const SLOTS: usize> TimeQ<SLOTS>
impl<const SLOTS: usize> TimeQ<SLOTS>
pub fn new(tick_resolution: Duration) -> Self
pub fn clear(&mut self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn tick_resolution(&self) -> Duration
Sourcepub fn insert(&mut self, message: Message) -> Result<(), Message>
pub fn insert(&mut self, message: Message) -> Result<(), Message>
Insert a message. If it is due immediately, Err(message) will be returned.
Sourcepub fn cancel(&mut self, message: &Message) -> bool
pub fn cancel(&mut self, message: &Message) -> bool
Cancel/remove the currently scheduled entry for a given message, returning true if the message was scheduled, or false otherwise
pub fn contains(&self, message: &Message) -> bool
Sourcepub fn pop(&mut self) -> MessageList
pub fn pop(&mut self) -> MessageList
Pop all messages that are due now
Trait Implementations§
Auto Trait Implementations§
impl<const SLOTS: usize> Freeze for TimeQ<SLOTS>
impl<const SLOTS: usize = 4> !RefUnwindSafe for TimeQ<SLOTS>
impl<const SLOTS: usize> Send for TimeQ<SLOTS>
impl<const SLOTS: usize> Sync for TimeQ<SLOTS>
impl<const SLOTS: usize> Unpin for TimeQ<SLOTS>
impl<const SLOTS: usize = 4> !UnwindSafe for TimeQ<SLOTS>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more