tensor_toolbox::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.

Object Safety§

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§