Trait linked_list::Wrapper
source · pub trait Wrapper<T: ?Sized> {
// Required methods
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§
sourcefn into_pointer(self) -> NonNull<T>
fn into_pointer(self) -> NonNull<T>
Converts the wrapped object into a pointer that represents it.
sourceunsafe fn from_pointer(ptr: NonNull<T>) -> Self
unsafe fn from_pointer(ptr: NonNull<T>) -> Self
Converts the object back from the pointer representation.
Safety
The passed pointer must come from a previous call to Wrapper::into_pointer()
.
Object Safety§
This trait is not object safe.