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() -> Selfwhere
P: CuListZeroedInit,
pub fn create(&mut self) -> Option<&mut CopperList<P>>
Sourcepub fn next_cl_id(&self) -> u64
pub fn next_cl_id(&self) -> u64
Returns the next copper-list id that will be assigned by create.
Sourcepub fn last_cl_id(&self) -> u64
pub fn last_cl_id(&self) -> u64
Returns the most recently assigned copper-list id.
Before the first call to create, this returns 0.
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.
Trait Implementations§
Source§impl<P: CopperListTuple + CuListZeroedInit, const N: usize> Default for CuListsManager<P, N>
impl<P: CopperListTuple + CuListZeroedInit, const N: usize> Default for CuListsManager<P, N>
Auto Trait Implementations§
impl<P, const N: usize> Freeze for CuListsManager<P, N>
impl<P, const N: usize> RefUnwindSafe for CuListsManager<P, N>where
P: RefUnwindSafe,
impl<P, const N: usize> Send for CuListsManager<P, N>where
P: Send,
impl<P, const N: usize> Sync for CuListsManager<P, N>where
P: Sync,
impl<P, const N: usize> Unpin for CuListsManager<P, N>
impl<P, const N: usize> UnsafeUnpin for CuListsManager<P, N>
impl<P, const N: usize> UnwindSafe for CuListsManager<P, N>where
P: 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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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>
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>
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