Trait switchboard_solana::prelude::borsh::BorshSchema
pub trait BorshSchema {
// Required methods
fn add_definitions_recursively(
definitions: &mut HashMap<String, Definition>
);
fn declaration() -> String;
// Provided methods
fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, 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<String, Definition>)
fn add_definitions_recursively(definitions: &mut HashMap<String, 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() -> String
fn declaration() -> String
Get the name of the type without brackets.
Provided Methods§
fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition>
)
fn add_definition( declaration: String, definition: Definition, definitions: &mut HashMap<String, Definition> )
Helper method to add a single type definition to the map.
fn schema_container() -> BorshSchemaContainer
Object Safety§
This trait is not object safe.