pub trait Listwhere
    Self: Sized,{
    type Elem: ListElement;

Show 16 methods // Required methods fn as_list_ptr(&self) -> *mut spa_list; fn from_list_ptr(ptr: *mut spa_list) -> *mut Self; // Provided methods fn init(&mut self) { ... } fn initialized(&self) -> bool { ... } fn empty(&self) -> bool { ... } unsafe fn insert(&mut self, elem: &mut Self::Elem) { ... } unsafe fn insert_list(&mut self, other: &mut Self) { ... } unsafe fn next(&self, current: &Self::Elem) -> Option<&mut Self::Elem> { ... } unsafe fn prev(&self, current: &Self::Elem) -> Option<&mut Self::Elem> { ... } unsafe fn first(&self) -> Option<&mut Self::Elem> { ... } unsafe fn last(&self) -> Option<&mut Self::Elem> { ... } unsafe fn append(&mut self, elem: &mut Self::Elem) { ... } unsafe fn prepend(&mut self, elem: &mut Self::Elem) { ... } unsafe fn clean(&mut self) { ... } unsafe fn iter(&self) -> ListIterator<'_, Self> { ... } unsafe fn iter_mut(&self) -> ListMutIterator<'_, Self> { ... }
}
Expand description

Linked list with ListElement In general, this struct should not be used outside the library.

Required Associated Types§

Required Methods§

source

fn as_list_ptr(&self) -> *mut spa_list

Raw pointer to the list itself

source

fn from_list_ptr(ptr: *mut spa_list) -> *mut Self

Cast the list pointer to Self

Provided Methods§

source

fn init(&mut self)

Init the list structure as empty list

source

fn initialized(&self) -> bool

Check if this list was initialized

source

fn empty(&self) -> bool

source

unsafe fn insert(&mut self, elem: &mut Self::Elem)

Insert ListElement to the list

Safety

Self::as_list_ptr must provide valid non-null pointer, that will not be changed in future.

source

unsafe fn insert_list(&mut self, other: &mut Self)

Join two lists

Safety

Self::as_list_ptr must provide valid non-null pointer, that will not be changed in future.

source

unsafe fn next(&self, current: &Self::Elem) -> Option<&mut Self::Elem>

Get the next element from the list

Safety

Self::as_list_ptr must provide valid non-null pointer, that will not be changed in future.

source

unsafe fn prev(&self, current: &Self::Elem) -> Option<&mut Self::Elem>

Get the previous element from the list

Safety

Self::as_list_ptr must provide valid non-null pointer, that will not be changed in future.

source

unsafe fn first(&self) -> Option<&mut Self::Elem>

Get the first element from the list

Safety

Self::as_list_ptr must provide valid non-null pointer, that will not be changed in future.

source

unsafe fn last(&self) -> Option<&mut Self::Elem>

Get the last element from the list

Safety

Self::as_list_ptr must provide valid non-null pointer, that will not be changed in future.

source

unsafe fn append(&mut self, elem: &mut Self::Elem)

Append element to the list

Safety

Self::as_list_ptr must provide valid non-null pointer, that will not be changed in future.

source

unsafe fn prepend(&mut self, elem: &mut Self::Elem)

Prepend element to the list

Safety

Self::as_list_ptr must provide valid non-null pointer, that will not be changed in future.

source

unsafe fn clean(&mut self)

Clean the list

Safety

Self::as_list_ptr must provide valid non-null pointer, that will not be changed in future.

source

unsafe fn iter(&self) -> ListIterator<'_, Self>

Get the list iterator

Safety

Self::as_list_ptr must provide valid non-null pointer, that will not be changed in future.

source

unsafe fn iter_mut(&self) -> ListMutIterator<'_, Self>

Get the list mut iterator

Safety

Self::as_list_ptr must provide valid non-null pointer, that will not be changed in future.

Implementors§