Skip to main content

Nullable

Trait Nullable 

Source
pub trait Nullable:
    AnchorSerialize
    + AnchorDeserialize
    + PartialEq {
    const NONE: Self;

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

Used for Borsh types that can have a None value.

Required Associated Constants§

Source

const NONE: Self

The value that represents None.

Provided Methods§

Source

fn is_some(&self) -> bool

Indicates if the value is Some.

Source

fn is_none(&self) -> bool

Indicates if the value is None.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Nullable for Pubkey

Source§

const NONE: Self = DEFAULT_PUBKEY

Source§

impl Nullable for u8

Source§

const NONE: Self = 0

Source§

impl Nullable for u16

Source§

const NONE: Self = 0

Source§

impl Nullable for u32

Source§

const NONE: Self = 0

Source§

impl Nullable for u64

Source§

const NONE: Self = 0

Source§

impl Nullable for u128

Source§

const NONE: Self = 0

Source§

impl Nullable for usize

Source§

const NONE: Self = 0

Implementors§