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 fn project<'__this>(self: Pin<&'__this mut Self>) -> __Projection<'__this>
pub fn project<'__this>(self: Pin<&'__this mut Self>) -> __Projection<'__this>
Pin-projects all fields of Self.
These fields are structurally pinned:
inner
These fields are not structurally pinned:
Sourcepub fn with_project<'__this, R>(
self: Pin<&'__this mut Self>,
f: impl FnOnce(__ProjectionLt<'__this>) -> R,
) -> R
pub fn with_project<'__this, R>( self: Pin<&'__this mut Self>, f: impl FnOnce(__ProjectionLt<'__this>) -> R, ) -> R
Pin-projects all fields of Self with proper lifetime.
These fields are structurally pinned:
inner
These fields are not structurally pinned:
Sourcepub fn with_project_ref<'__this, R>(
self: Pin<&'__this Self>,
f: impl FnOnce(__ProjectionRef<'__this>) -> R,
) -> R
pub fn with_project_ref<'__this, R>( self: Pin<&'__this Self>, f: impl FnOnce(__ProjectionRef<'__this>) -> R, ) -> R
Pin-projects all fields of Self from a shared reference with proper lifetime.
These fields are structurally pinned:
inner
These fields are not structurally pinned:
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
Source§fn into_safe_cast(self) -> T
fn into_safe_cast(self) -> T
Convert
self into a T. This operation is guaranteed to be lossless.Source§impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
Source§fn into_safe_cast_arch(self) -> T
fn into_safe_cast_arch(self) -> T
Convert
self into a T. This operation is guaranteed to be lossless.