Trait ptr_meta::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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

§

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§