pub struct CuListsManager<P, const N: usize>where
P: CopperListTuple,{ /* 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, const N: usize> CuListsManager<P, N>where
P: CopperListTuple,
impl<P, const N: usize> CuListsManager<P, N>where
P: CopperListTuple,
pub fn new() -> CuListsManager<P, N>
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,
) -> Chain<Rev<Iter<'_, CopperList<P>>>, Rev<Iter<'_, CopperList<P>>>> ⓘ
pub fn iter( &self, ) -> Chain<Rev<Iter<'_, CopperList<P>>>, Rev<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,
) -> Chain<Rev<IterMut<'_, CopperList<P>>>, Rev<IterMut<'_, CopperList<P>>>> ⓘ
pub fn iter_mut( &mut self, ) -> Chain<Rev<IterMut<'_, CopperList<P>>>, Rev<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,
) -> Chain<Iter<'_, CopperList<P>>, Iter<'_, CopperList<P>>> ⓘ
pub fn asc_iter( &self, ) -> Chain<Iter<'_, CopperList<P>>, Iter<'_, 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,
) -> Chain<IterMut<'_, CopperList<P>>, IterMut<'_, CopperList<P>>> ⓘ
pub fn asc_iter_mut( &mut self, ) -> Chain<IterMut<'_, CopperList<P>>, IterMut<'_, 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.