pub enum Fields {
NamedFields(Vec<(FieldName, Declaration)>),
UnnamedFields(Vec<Declaration>),
Empty,
}
Expand description
The collection representing the fields of a struct.
Variants§
NamedFields(Vec<(FieldName, Declaration)>)
The struct with named fields, structurally identical to a tuple.
FieldName
is metadata, not present in a type’s serialized representation.
UnnamedFields(Vec<Declaration>)
The struct with unnamed fields, structurally identical to a tuple.
Empty
The struct with no fields, structurally identical to an empty tuple.
Trait Implementations§
source§impl BorshDeserialize for Fields
impl BorshDeserialize for Fields
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self>
fn deserialize(buf: &mut &[u8]) -> Result<Self>
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>
fn try_from_slice(v: &[u8]) -> Result<Self>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R: Read>(reader: &mut R) -> Result<Self>
source§impl BorshSchema for Fields
impl BorshSchema for Fields
source§fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
source§fn add_definitions_recursively(
definitions: &mut BTreeMap<Declaration, Definition>
)
fn add_definitions_recursively( definitions: &mut BTreeMap<Declaration, Definition> )
Recursively, using DFS, add type definitions required for this type.
Type definition partially explains how to serialize/deserialize a type.
source§impl BorshSerialize for Fields
impl BorshSerialize for Fields
source§impl PartialEq for Fields
impl PartialEq for Fields
impl Eq for Fields
impl StructuralPartialEq for Fields
Auto Trait Implementations§
impl Freeze for Fields
impl RefUnwindSafe for Fields
impl Send for Fields
impl Sync for Fields
impl Unpin for Fields
impl UnwindSafe for Fields
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