Type Alias cros_async::sync::waiter::WaiterList

source ·
pub type WaiterList = LinkedList<WaiterAdapter>;

Aliased Type§

struct WaiterList {
    head: Option<NonNull<AtomicLink>>,
    tail: Option<NonNull<AtomicLink>>,
    adapter: WaiterAdapter,
}

Fields§

§head: Option<NonNull<AtomicLink>>§tail: Option<NonNull<AtomicLink>>§adapter: WaiterAdapter

Implementations

§

impl<A> LinkedList<A>
where A: Adapter, <A as Adapter>::LinkOps: LinkedListOps,

pub fn new(adapter: A) -> LinkedList<A>

Creates an empty LinkedList.

pub fn is_empty(&self) -> bool

Returns true if the LinkedList is empty.

pub fn cursor(&self) -> Cursor<'_, A>

Returns a null Cursor for this list.

pub fn cursor_mut(&mut self) -> CursorMut<'_, A>

Returns a null CursorMut for this list.

pub fn cursor_owning(self) -> CursorOwning<A>

Returns a null CursorOwning for this list.

pub unsafe fn cursor_from_ptr( &self, ptr: *const <<A as Adapter>::PointerOps as PointerOps>::Value ) -> Cursor<'_, A>

Creates a Cursor from a pointer to an element.

§Safety

ptr must be a pointer to an object that is part of this list.

pub unsafe fn cursor_mut_from_ptr( &mut self, ptr: *const <<A as Adapter>::PointerOps as PointerOps>::Value ) -> CursorMut<'_, A>

Creates a CursorMut from a pointer to an element.

§Safety

ptr must be a pointer to an object that is part of this list.

pub unsafe fn cursor_owning_from_ptr( self, ptr: *const <<A as Adapter>::PointerOps as PointerOps>::Value ) -> CursorOwning<A>

Creates a CursorOwning from a pointer to an element.

§Safety

ptr must be a pointer to an object that is part of this list.

pub fn front(&self) -> Cursor<'_, A>

Returns a Cursor pointing to the first element of the list. If the list is empty then a null cursor is returned.

pub fn front_mut(&mut self) -> CursorMut<'_, A>

Returns a CursorMut pointing to the first element of the list. If the the list is empty then a null cursor is returned.

pub fn front_owning(self) -> CursorOwning<A>

Returns a CursorOwning pointing to the first element of the list. If the the list is empty then a null cursor is returned.

pub fn back(&self) -> Cursor<'_, A>

Returns a Cursor pointing to the last element of the list. If the list is empty then a null cursor is returned.

pub fn back_mut(&mut self) -> CursorMut<'_, A>

Returns a CursorMut pointing to the last element of the list. If the list is empty then a null cursor is returned.

pub fn back_owning(self) -> CursorOwning<A>

Returns a CursorOwning pointing to the last element of the list. If the list is empty then a null cursor is returned.

pub fn iter(&self) -> Iter<'_, A>

Gets an iterator over the objects in the LinkedList.

pub fn clear(&mut self)

Removes all elements from the LinkedList.

This will unlink all object currently in the list, which requires iterating through all elements in the LinkedList. Each element is converted back to an owned pointer and then dropped.

pub fn fast_clear(&mut self)

Empties the LinkedList without unlinking or freeing objects in it.

Since this does not unlink any objects, any attempts to link these objects into another LinkedList will fail but will not cause any memory unsafety. To unlink those objects manually, you must call the force_unlink function on them.

pub fn take(&mut self) -> LinkedList<A>
where A: Clone,

Takes all the elements out of the LinkedList, leaving it empty. The taken elements are returned as a new LinkedList.

pub fn push_front( &mut self, val: <<A as Adapter>::PointerOps as PointerOps>::Pointer )

Inserts a new element at the start of the LinkedList.

pub fn push_back( &mut self, val: <<A as Adapter>::PointerOps as PointerOps>::Pointer )

Inserts a new element at the end of the LinkedList.

pub fn pop_front( &mut self ) -> Option<<<A as Adapter>::PointerOps as PointerOps>::Pointer>

Removes the first element of the LinkedList.

This returns None if the LinkedList is empty.

pub fn pop_back( &mut self ) -> Option<<<A as Adapter>::PointerOps as PointerOps>::Pointer>

Removes the last element of the LinkedList.

This returns None if the LinkedList is empty.

Trait Implementations

§

impl<A> Send for LinkedList<A>
where A: Adapter + Send, <<A as Adapter>::PointerOps as PointerOps>::Pointer: Send, <A as Adapter>::LinkOps: LinkedListOps,

§

impl<A> Drop for LinkedList<A>
where A: Adapter, <A as Adapter>::LinkOps: LinkedListOps,

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

impl<A> IntoIterator for LinkedList<A>
where A: Adapter, <A as Adapter>::LinkOps: LinkedListOps,

§

type Item = <<A as Adapter>::PointerOps as PointerOps>::Pointer

The type of the elements being iterated over.
§

type IntoIter = IntoIter<A>

Which kind of iterator are we turning this into?
§

fn into_iter(self) -> IntoIter<A>

Creates an iterator from a value. Read more
§

impl<A> Default for LinkedList<A>
where A: Adapter + Default, <A as Adapter>::LinkOps: LinkedListOps,

§

fn default() -> LinkedList<A>

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

impl<A> Debug for LinkedList<A>
where A: Adapter, <A as Adapter>::LinkOps: LinkedListOps, <<A as Adapter>::PointerOps as PointerOps>::Value: Debug,

§

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

Formats the value using the given formatter. Read more
§

impl<A> Sync for LinkedList<A>
where A: Adapter + Sync, <<A as Adapter>::PointerOps as PointerOps>::Value: Sync, <A as Adapter>::LinkOps: LinkedListOps,