Trait NonNullExt

Source
pub trait NonNullExt<T: Pointee + ?Sized> {
    type Raw;

    // Required methods
    fn from_raw_parts(raw: Self::Raw, meta: <T as Pointee>::Metadata) -> Self;
    fn to_raw_parts(self) -> (Self::Raw, <T as Pointee>::Metadata);
}
Expand description

Extension methods for NonNull.

Required Associated Types§

Source

type Raw

The type’s raw pointer (NonNull<()>).

Required Methods§

Source

fn from_raw_parts(raw: Self::Raw, meta: <T as Pointee>::Metadata) -> Self

Creates a new non-null pointer from its raw parts.

Source

fn to_raw_parts(self) -> (Self::Raw, <T as Pointee>::Metadata)

Converts a non-null pointer to its raw parts.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: Pointee + ?Sized> NonNullExt<T> for NonNull<T>

Source§

type Raw = NonNull<()>

Source§

fn from_raw_parts(raw: Self::Raw, meta: <T as Pointee>::Metadata) -> Self

Source§

fn to_raw_parts(self) -> (Self::Raw, <T as Pointee>::Metadata)

Implementors§