Trait NoneIsNull

Source
pub trait NoneIsNull: Sized { }
Expand description

Many types are not themselves nullable, but when wrapped in an Option effectively use None as null (especially with the niche-filling optimization).

This includes references, NonNull, and most smart pointers (including all of the smart pointers in std).

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<'a, T: ?Sized> NoneIsNull for &'a T

Source§

impl<'a, T: ?Sized> NoneIsNull for &'a mut T

Source§

impl<T: ?Sized> NoneIsNull for Box<T>

Source§

impl<T: ?Sized> NoneIsNull for Rc<T>

Source§

impl<T: ?Sized> NoneIsNull for Weak<T>

Source§

impl<T: ?Sized> NoneIsNull for Arc<T>

Source§

impl<T: ?Sized> NoneIsNull for Weak<T>

Source§

impl<T: ?Sized> NoneIsNull for NonNull<T>

Implementors§