Nullable

Trait Nullable 

Source
pub trait Nullable {
    const NULL: Self;

    // Required method
    fn is_null(&self) -> bool;
}
Expand description

A trait for defining nullable values.

Required Associated Constants§

Source

const NULL: Self

The null value for the type.

Required Methods§

Source

fn is_null(&self) -> bool

Returns true if the value is null. Typically, this is a comparison with the null value.

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> Nullable for Option<T>

Source§

const NULL: Self = None

Source§

fn is_null(&self) -> bool

Source§

impl<T> Nullable for *const T

Source§

const NULL: Self

Source§

fn is_null(&self) -> bool

Source§

impl<T> Nullable for *mut T

Source§

const NULL: Self

Source§

fn is_null(&self) -> bool

Implementors§