Skip to main content Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. Rust
  4. pw_kernel
  5. list
  6. ForeignList

ForeignList

Struct ForeignList 

Source
pub struct ForeignList<T, A: Adapter<T>> { /* private fields */ }

Implementations§

Source§

impl<T, A: Adapter<T>> ForeignList<T, A>

Source

pub const fn new() -> Self

Source

pub fn is_empty(&self) -> bool

Source

pub fn push_front(&mut self, element: ForeignBox<T>)

Source

pub fn push_back(&mut self, element: ForeignBox<T>)

Source

pub fn pop_head(&mut self) -> Option<ForeignBox<T>>

Source

pub fn for_each<E, F: FnMut(&T) -> Result<(), E>>( &self, callback: F, ) -> Result<(), E>

Source

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

Source

pub unsafe fn remove_element( &mut self, element: NonNull<T>, ) -> Option<ForeignBox<T>>

§Safety

Caller ensures element is a valid pointer to an instance of T that is either unlinked or currently linked in self. Caller must also have exclusive access to the list and its members for the duration of the call: no live &/&mut references to element or its neighbors may be used across it.

Source

pub unsafe fn remove_element_unchecked( &mut self, element: NonNull<T>, ) -> ForeignBox<T>

§Safety

Caller ensures element is a valid pointer to an instance of T that is currently linked in self. Caller must also have exclusive access to the list and its members for the duration of the call: no live &/&mut references to element or its neighbors may be used across it.

Source§

impl<T, A: Adapter<T>> ForeignList<T, A>

Source

pub fn sorted_insert_by_key<F: FnMut(&T) -> K, K: Ord>( &mut self, element: ForeignBox<T>, f: F, )

Source

pub fn sorted_insert_by<F: FnMut(&T, &T) -> Ordering>( &mut self, element: ForeignBox<T>, compare: F, )

Trait Implementations§

Source§

impl<T, A: Adapter<T>> Default for ForeignList<T, A>

Source§

fn default() -> Self

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

impl<T, A: Adapter<T>> Drop for ForeignList<T, A>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<T: Send, A: Adapter<T>> Send for ForeignList<T, A>

Source§

impl<T: Sync, A: Adapter<T>> Sync for ForeignList<T, A>

Auto Trait Implementations§

§

impl<T, A> !RefUnwindSafe for ForeignList<T, A>

§

impl<T, A> !UnwindSafe for ForeignList<T, A>

§

impl<T, A> Forget for ForeignList<T, A>

§

impl<T, A> Freeze for ForeignList<T, A>
where UnsafeList<T, A>: Freeze,

§

impl<T, A> Move for ForeignList<T, A>

§

impl<T, A> Unpin for ForeignList<T, A>
where UnsafeList<T, A>: Unpin,

§

impl<T, A> UnsafeUnpin for ForeignList<T, A>
where UnsafeList<T, A>: UnsafeUnpin,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.