pub struct ForeignList<T, A: Adapter<T>> { /* private fields */ }Implementations§
Source§impl<T, A: Adapter<T>> ForeignList<T, A>
impl<T, A: Adapter<T>> ForeignList<T, A>
pub const fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn push_front(&mut self, element: ForeignBox<T>)
pub fn push_back(&mut self, element: ForeignBox<T>)
pub fn pop_head(&mut self) -> Option<ForeignBox<T>>
pub fn for_each<E, F: FnMut(&T) -> Result<(), E>>( &self, callback: F, ) -> Result<(), E>
pub fn iter(&self) -> Iter<'_, T, A>
Sourcepub unsafe fn remove_element(
&mut self,
element: NonNull<T>,
) -> Option<ForeignBox<T>>
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.
Sourcepub unsafe fn remove_element_unchecked(
&mut self,
element: NonNull<T>,
) -> ForeignBox<T>
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.