Enum switchboard_aggregator::borsh::schema::Definition [−][src]
pub enum Definition {
Array {
length: u32,
elements: String,
},
Sequence {
elements: String,
},
Tuple {
elements: Vec<String, Global>,
},
Enum {
variants: Vec<(String, String), Global>,
},
Struct {
fields: Fields,
},
}
Expand description
The type that we use to represent the definition of the Borsh type.
Variants
A fixed-size array with the length known at the compile time and the same-type elements.
A sequence of elements of length known at the run time and the same-type elements.
Fields of Sequence
elements: String
A fixed-size tuple with the length known at the compile time and the elements of different types.
A tagged union, a.k.a enum. Tagged-unions have variants with associated structures.
A structure, structurally similar to a tuple.
Fields of Struct
fields: Fields
Trait Implementations
impl BorshDeserialize for Definition where
u32: BorshDeserialize,
String: BorshDeserialize,
Vec<String, Global>: BorshDeserialize,
Vec<(String, String), Global>: BorshDeserialize,
Fields: BorshDeserialize,
impl BorshDeserialize for Definition where
u32: BorshDeserialize,
String: BorshDeserialize,
Vec<String, Global>: BorshDeserialize,
Vec<(String, String), Global>: BorshDeserialize,
Fields: BorshDeserialize,
Get the name of the type without brackets.
pub fn add_definitions_recursively(
definitions: &mut HashMap<String, Definition, RandomState>
)
pub fn add_definitions_recursively(
definitions: &mut HashMap<String, Definition, RandomState>
)
Recursively, using DFS, add type definitions required for this type. For primitive types this is an empty map. Type definition explains how to serialize/deserialize a type. Read more
fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
Helper method to add a single type definition to the map.
impl BorshSerialize for Definition where
u32: BorshSerialize,
String: BorshSerialize,
Vec<String, Global>: BorshSerialize,
Vec<(String, String), Global>: BorshSerialize,
Fields: BorshSerialize,
impl BorshSerialize for Definition where
u32: BorshSerialize,
String: BorshSerialize,
Vec<String, Global>: BorshSerialize,
Vec<(String, String), Global>: BorshSerialize,
Fields: BorshSerialize,
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.