spl_pod::option

Trait Nullable

Source
pub trait Nullable:
    PartialEq
    + Pod
    + Sized {
    const NONE: Self;

    // Provided methods
    fn is_none(&self) -> bool { ... }
    fn is_some(&self) -> bool { ... }
}
Expand description

Trait for types that can be None.

This trait is used to indicate that a type can be None according to a specific value.

Required Associated Constants§

Source

const NONE: Self

Value that represents None for the type.

Provided Methods§

Source

fn is_none(&self) -> bool

Indicates whether the value is None or not.

Source

fn is_some(&self) -> bool

Indicates whether the value is Some`` value of type T`` or not.

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 Pubkey

Implementation of Nullable for Pubkey.

Source§

const NONE: Self = _

Implementors§