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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Nullable for u8

Source§

const NONE: Self = 0u8

Source§

impl Nullable for u16

Source§

const NONE: Self = 0u16

Source§

impl Nullable for u32

Source§

const NONE: Self = 0u32

Source§

impl Nullable for u64

Source§

const NONE: Self = 0u64

Source§

impl Nullable for u128

Source§

const NONE: Self = 0u128

Source§

impl Nullable for usize

Source§

const NONE: Self = 0usize

Source§

impl Nullable for Pubkey

Source§

const NONE: Self = DEFAULT_PUBKEY

Implementors§