Trait kernel::list::HasListLinks

source ·
pub unsafe trait HasListLinks<const ID: u64 = 0> {
    const OFFSET: usize;

    // Provided method
    unsafe fn raw_get_list_links(ptr: *mut Self) -> *mut ListLinks<ID> { ... }
}
Expand description

Declares that this type has a ListLinks<ID> field at a fixed offset.

This trait is only used to help implement ListItem safely. If ListItem is implemented manually, then this trait is not needed. Use the impl_has_list_links! macro to implement this trait.

§Safety

All values of this type must have a ListLinks<ID> field at the given offset.

The behavior of raw_get_list_links must not be changed.

Required Associated Constants§

source

const OFFSET: usize

The offset of the ListLinks field.

Provided Methods§

Returns a pointer to the ListLinks<T, ID> field.

§Safety

The provided pointer must point at a valid struct of type Self.

Object Safety§

This trait is not object safe.

Implementors§