cu29::prelude

Struct CuListsManager

Source
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,

Source

pub fn new() -> CuListsManager<P, N>

Source

pub fn len(&self) -> usize

Returns the current number of elements in the queue.

Source

pub fn is_empty(&self) -> bool

Returns true if the queue contains no elements.

Source

pub fn is_full(&self) -> bool

Returns true if the queue is full.

Source

pub fn clear(&mut self)

Clears the queue.

Source

pub fn create(&mut self) -> Option<&mut CopperList<P>>

Source

pub fn peek(&self) -> Option<&CopperList<P>>

Peeks at the last element in the queue.

Source

pub fn pop(&mut self) -> Option<&mut CopperList<P>>

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl<P, const N: usize> Debug for CuListsManager<P, N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<P, const N: usize> Default for CuListsManager<P, N>
where P: CopperListTuple,

Source§

fn default() -> CuListsManager<P, N>

Returns the “default value” for a type. Read more

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> UnwindSafe for CuListsManager<P, N>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T