pub struct CuListsManager<P: CopperListTuple, const N: usize> { /* private fields */ }
Expand description
This structure maintains the entire memory needed by Copper for one loop for the inter tasks communication within a process. P or Payload is typically a Tuple of various types of messages that are exchanged between tasks. N is the maximum number of in flight Copper List the runtime can support.
Implementations§
Source§impl<P: CopperListTuple, const N: usize> CuListsManager<P, N>
impl<P: CopperListTuple, const N: usize> CuListsManager<P, N>
pub fn new() -> Self
pub fn create(&mut self) -> Option<&mut CopperList<P>>
Sourcepub fn peek(&self) -> Option<&CopperList<P>>
pub fn peek(&self) -> Option<&CopperList<P>>
Peeks at the last element in the queue.
pub fn pop(&mut self) -> Option<&mut CopperList<P>>
Sourcepub fn iter(&self) -> Iter<'_, CopperList<P>>
pub fn iter(&self) -> Iter<'_, CopperList<P>>
Returns an iterator over the queue’s contents.
The iterator goes from the most recently pushed items to the oldest ones.
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, CopperList<P>>
pub fn iter_mut(&mut self) -> IterMut<'_, CopperList<P>>
Returns a mutable iterator over the queue’s contents.
The iterator goes from the most recently pushed items to the oldest ones.
Sourcepub fn asc_iter(&self) -> AscIter<'_, CopperList<P>>
pub fn asc_iter(&self) -> AscIter<'_, CopperList<P>>
Returns an ascending iterator over the queue’s contents.
The iterator goes from the least recently pushed items to the newest ones.
Sourcepub fn asc_iter_mut(&mut self) -> AscIterMut<'_, CopperList<P>>
pub fn asc_iter_mut(&mut self) -> AscIterMut<'_, CopperList<P>>
Returns a mutable ascending iterator over the queue’s contents.
The iterator goes from the least recently pushed items to the newest ones.