Struct switchboard_solana::prelude::borsh::schema::BorshSchemaContainer
pub struct BorshSchemaContainer {
pub declaration: String,
pub definitions: HashMap<String, Definition>,
}
Expand description
All schema information needed to deserialize a single type.
Fields§
§declaration: String
Declaration of the type.
definitions: HashMap<String, Definition>
All definitions needed to deserialize the given type.
Trait Implementations§
§impl BorshDeserialize for BorshSchemaContainer
impl BorshDeserialize for BorshSchemaContainer
fn deserialize_reader<R>(reader: &mut R) -> Result<BorshSchemaContainer, Error>where
R: Read,
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
§impl BorshSerialize for BorshSchemaContainer
impl BorshSerialize for BorshSchemaContainer
§impl BorshSchema for BorshSchemaContainer
impl BorshSchema for BorshSchemaContainer
§fn declaration() -> String
fn declaration() -> String
Get the name of the type without brackets.
§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 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
§impl Clone for BorshSchemaContainer
impl Clone for BorshSchemaContainer
§fn clone(&self) -> BorshSchemaContainer
fn clone(&self) -> BorshSchemaContainer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for BorshSchemaContainer
impl Debug for BorshSchemaContainer
§impl PartialEq for BorshSchemaContainer
impl PartialEq for BorshSchemaContainer
§fn eq(&self, other: &BorshSchemaContainer) -> bool
fn eq(&self, other: &BorshSchemaContainer) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for BorshSchemaContainer
impl StructuralPartialEq for BorshSchemaContainer
Auto Trait Implementations§
impl Freeze for BorshSchemaContainer
impl RefUnwindSafe for BorshSchemaContainer
impl Send for BorshSchemaContainer
impl Sync for BorshSchemaContainer
impl Unpin for BorshSchemaContainer
impl UnwindSafe for BorshSchemaContainer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more