Enum borsh::schema::Definition[][src]

[]
pub enum Definition {
    Array {
        length: u32,
        elements: Declaration,
    },
    Sequence {
        elements: Declaration,
    },
    Tuple {
        elements: Vec<Declaration>,
    },
    Enum {
        variants: Vec<(VariantName, Declaration)>,
    },
    Struct {
        fields: Fields,
    },
}
[]

The type that we use to represent the definition of the Borsh type.

Variants

Array
[]

A fixed-size array with the length known at the compile time and the same-type elements.

[]

Fields of Array

length: u32elements: Declaration
Sequence
[]

A sequence of elements of length known at the run time and the same-type elements.

[]

Fields of Sequence

elements: Declaration
Tuple
[]

A fixed-size tuple with the length known at the compile time and the elements of different types.

[]

Fields of Tuple

elements: Vec<Declaration>
Enum
[]

A tagged union, a.k.a enum. Tagged-unions have variants with associated structures.

[]

Fields of Enum

variants: Vec<(VariantName, Declaration)>
Struct
[]

A structure, structurally similar to a tuple.

[]

Fields of Struct

fields: Fields

Trait Implementations

impl BorshDeserialize for Definition where
    u32: BorshDeserialize,
    Declaration: BorshDeserialize,
    Declaration: BorshDeserialize,
    Vec<Declaration>: BorshDeserialize,
    Vec<(VariantName, Declaration)>: BorshDeserialize,
    Fields: BorshDeserialize
[src][+]

impl BorshSchema for Definition[src][+]

impl BorshSerialize for Definition where
    u32: BorshSerialize,
    Declaration: BorshSerialize,
    Declaration: BorshSerialize,
    Vec<Declaration>: BorshSerialize,
    Vec<(VariantName, Declaration)>: BorshSerialize,
    Fields: BorshSerialize
[src][+]

impl Debug for Definition[src][+]

impl PartialEq<Definition> for Definition[src][+]

impl StructuralPartialEq for Definition[src]

Auto Trait Implementations

impl RefUnwindSafe for Definition

impl Send for Definition

impl Sync for Definition

impl Unpin for Definition

impl UnwindSafe for Definition

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src][+]

impl<T> Borrow<T> for T where
    T: ?Sized
[src][+]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src][+]

impl<T> From<T> for T[src][+]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src][+]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src][+]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src][+]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.