pub struct Messages<M: Message> { /* private fields */ }
Expand description
Container for managing messages of a specific type.
This struct maintains separate lists for messages from the current and previous frames.
Implementations§
Source§impl<M: Message> Messages<M>
impl<M: Message> Messages<M>
Sourcepub fn swap(&mut self)
pub fn swap(&mut self)
Swaps the current and previous frame message lists.
This should be called at the start of each new frame (update) to transition messages appropriately.
Sourcepub fn iter_current(&self) -> MessagesIterator<'_, M> ⓘ
pub fn iter_current(&self) -> MessagesIterator<'_, M> ⓘ
Returns an iterator over the current frame’s messages.
Sourcepub fn iter_previous(&self) -> MessagesIterator<'_, M> ⓘ
pub fn iter_previous(&self) -> MessagesIterator<'_, M> ⓘ
Returns an iterator over the previous frame’s messages.
Sourcepub fn len_current(&self) -> usize
pub fn len_current(&self) -> usize
Returns the number of messages in the current frame.
Sourcepub fn len_previous(&self) -> usize
pub fn len_previous(&self) -> usize
Returns the number of messages in the previous frame.
Sourcepub fn is_empty_current(&self) -> bool
pub fn is_empty_current(&self) -> bool
Checks if there are no messages in the current frame.
Sourcepub fn is_empty_previous(&self) -> bool
pub fn is_empty_previous(&self) -> bool
Checks if there are no messages in the previous frame.
Trait Implementations§
Source§impl<M: Message> MessageContainer for Messages<M>
impl<M: Message> MessageContainer for Messages<M>
impl<M: Message> Resource for Messages<M>
Auto Trait Implementations§
impl<M> Freeze for Messages<M>
impl<M> RefUnwindSafe for Messages<M>where
M: RefUnwindSafe,
impl<M> Send for Messages<M>
impl<M> Sync for Messages<M>
impl<M> Unpin for Messages<M>where
M: Unpin,
impl<M> UnwindSafe for Messages<M>where
M: 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