Trait borsh::schema::BorshSchema
source · [−]pub trait BorshSchema {
fn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
);
fn declaration() -> Declaration;
fn add_definition(
declaration: Declaration,
definition: Definition,
definitions: &mut HashMap<Declaration, Definition>
) { ... }
fn schema_container() -> BorshSchemaContainer { ... }
}
Expand description
The declaration and the definition of the type that can be used to (de)serialize Borsh without the Rust type that produced it.
Required methods
fn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
fn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
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.
fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
Provided methods
fn add_definition(
declaration: Declaration,
definition: Definition,
definitions: &mut HashMap<Declaration, Definition>
)
fn add_definition(
declaration: Declaration,
definition: Definition,
definitions: &mut HashMap<Declaration, Definition>
)
Helper method to add a single type definition to the map.