pub trait Wrapper<T: ?Sized> {
    fn into_pointer(self) -> NonNull<T>;
    unsafe fn from_pointer(ptr: NonNull<T>) -> Self;
    fn as_ref(&self) -> &T;
}
Expand description

Wraps an object to be inserted in a linked list.

Required Methods

Converts the wrapped object into a pointer that represents it.

Converts the object back from the pointer representation.

Safety

The passed pointer must come from a previous call to Wrapper::into_pointer().

Returns a reference to the wrapped object.

Implementations on Foreign Types

Implementors

This documentation is an old archive. Please see https://rust.docs.kernel.org instead.