pub enum BorshSchema {
Show 25 variants
Null,
Bool,
U8,
U16,
U32,
U64,
U128,
I8,
I16,
I32,
I64,
I128,
F32,
F64,
String,
Option {
schema: Box<BorshSchema>,
},
Array {
schema: Box<BorshSchema>,
len: u32,
},
Struct {
fields: Vec<(String, BorshSchema)>,
},
Enum {
variants: Vec<(String, BorshSchema)>,
},
Vector {
schema: Box<BorshSchema>,
},
Map {
key: Box<BorshSchema>,
value: Box<BorshSchema>,
},
Set {
schema: Box<BorshSchema>,
},
Blob,
Snapshot,
Link,
}
Expand description
A borsh
schema describing the data format of a [Component
][crate::Component].
Variants§
Null
Bool
U8
U16
U32
U64
U128
I8
I16
I32
I64
I128
F32
F64
String
Option
Fields
§
schema: Box<BorshSchema>
Array
Struct
Fields
§
fields: Vec<(String, BorshSchema)>
Enum
Fields
§
variants: Vec<(String, BorshSchema)>
Vector
Fields
§
schema: Box<BorshSchema>
Map
Set
Fields
§
schema: Box<BorshSchema>
Blob
Snapshot
Link
Trait Implementations§
Source§impl BorshDeserialize for BorshSchema
impl BorshDeserialize for BorshSchema
fn deserialize_reader<__R>(reader: &mut __R) -> Result<BorshSchema, Error>where
__R: Read,
Source§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.
Source§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,
Source§impl BorshSerialize for BorshSchema
impl BorshSerialize for BorshSchema
Source§impl Clone for BorshSchema
impl Clone for BorshSchema
Source§fn clone(&self) -> BorshSchema
fn clone(&self) -> BorshSchema
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 moreSource§impl Debug for BorshSchema
impl Debug for BorshSchema
Source§impl EnumExt for BorshSchema
impl EnumExt for BorshSchema
Source§fn deserialize_variant<__R>(
reader: &mut __R,
variant_tag: u8,
) -> Result<BorshSchema, Error>where
__R: Read,
fn deserialize_variant<__R>(
reader: &mut __R,
variant_tag: u8,
) -> Result<BorshSchema, Error>where
__R: Read,
Deserialises given variant of an enum from the reader. Read more
Auto Trait Implementations§
impl Freeze for BorshSchema
impl RefUnwindSafe for BorshSchema
impl Send for BorshSchema
impl Sync for BorshSchema
impl Unpin for BorshSchema
impl UnwindSafe for BorshSchema
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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