Skip to main content

NonNullable

Trait NonNullable 

Source
pub unsafe trait NonNullable { }
Expand description

Marker trait for types subject to the null pointer optimization.

§Safety

If zeroed is a valid bitpattern, undefined behavior will occur when trying to optimize memory.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl NonNullable for ()

Source§

impl NonNullable for NonZeroI8

Source§

impl NonNullable for NonZeroI16

Source§

impl NonNullable for NonZeroI32

Source§

impl NonNullable for NonZeroI64

Source§

impl NonNullable for NonZeroI128

Source§

impl NonNullable for NonZeroIsize

Source§

impl NonNullable for NonZeroU8

Source§

impl NonNullable for NonZeroU16

Source§

impl NonNullable for NonZeroU32

Source§

impl NonNullable for NonZeroU64

Source§

impl NonNullable for NonZeroU128

Source§

impl NonNullable for NonZeroUsize

Source§

impl<T> NonNullable for &T

Source§

impl<T> NonNullable for &mut T

Source§

impl<T> NonNullable for NonNull<T>

Implementors§