Trait Nullable

Source
pub trait Nullable {
    const NULL: Self;

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

An object which has an “obviously invalid” value, for use with the null_pointer_check!() macro.

This trait is implemented for all integer types and raw pointers, returning 0 and null respectively.

Required Associated Constants§

Source

const NULL: Self

Required Methods§

Source

fn is_null(&self) -> bool

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 Nullable for i8

Source§

const NULL: Self = 0i8

Source§

fn is_null(&self) -> bool

Source§

impl Nullable for i16

Source§

const NULL: Self = 0i16

Source§

fn is_null(&self) -> bool

Source§

impl Nullable for i32

Source§

const NULL: Self = 0i32

Source§

fn is_null(&self) -> bool

Source§

impl Nullable for i64

Source§

const NULL: Self = 0i64

Source§

fn is_null(&self) -> bool

Source§

impl Nullable for isize

Source§

const NULL: Self = 0isize

Source§

fn is_null(&self) -> bool

Source§

impl Nullable for u8

Source§

const NULL: Self = 0u8

Source§

fn is_null(&self) -> bool

Source§

impl Nullable for u16

Source§

const NULL: Self = 0u16

Source§

fn is_null(&self) -> bool

Source§

impl Nullable for u32

Source§

const NULL: Self = 0u32

Source§

fn is_null(&self) -> bool

Source§

impl Nullable for u64

Source§

const NULL: Self = 0u64

Source§

fn is_null(&self) -> bool

Source§

impl Nullable for ()

Source§

const NULL: Self = ()

Source§

fn is_null(&self) -> bool

Source§

impl Nullable for usize

Source§

const NULL: Self = 0usize

Source§

fn is_null(&self) -> bool

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§