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.



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

Fields of Array

length: u32elements: Declaration

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

Fields of Sequence

elements: Declaration

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

Fields of Tuple

elements: Vec<Declaration>

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

Fields of Enum

variants: Vec<(VariantName, Declaration)>

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

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

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.