pub struct CListHead { /* private fields */ }Expand description
FFI wrapper for a C list_head object used in intrusive linked lists.
§Invariants
- The underlying
list_headis initialized with valid non-NULLnext/prevpointers.
Implementations§
Source§impl CListHead
impl CListHead
Sourcepub unsafe fn from_raw<'a>(ptr: *mut list_head) -> &'a Self
pub unsafe fn from_raw<'a>(ptr: *mut list_head) -> &'a Self
Create a &CListHead reference from a raw list_head pointer.
§Safety
ptrmust be a valid pointer to an initializedlist_head(e.g. viaINIT_LIST_HEAD()), with valid non-NULLnext/prevpointers.ptrmust remain valid for the lifetime'a.- The list and all linked
list_headnodes must not be modified from anywhere for the lifetime'a, unless done so via anyCListHeadAPIs.
Trait Implementations§
impl Eq for CListHead
impl Send for CListHead
impl Sync for CListHead
Auto Trait Implementations§
impl !Freeze for CListHead
impl !RefUnwindSafe for CListHead
impl !UnsafeUnpin for CListHead
impl UnwindSafe for CListHead
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
Initializes
slot. Read more