#[repr(C)]pub struct ValidatorListHeader {
pub account_type: AccountType,
pub max_validators: u32,
}Expand description
Helper type to deserialize just the start of a ValidatorList
Fields§
§account_type: AccountTypeAccount type, must be ValidatorList currently
max_validators: u32Maximum allowable number of validators
Implementations§
Source§impl ValidatorListHeader
impl ValidatorListHeader
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Check if validator stake list is actually initialized as a validator stake list
Sourcepub fn is_uninitialized(&self) -> bool
pub fn is_uninitialized(&self) -> bool
Check if the validator stake list is uninitialized
Sourcepub fn deserialize_mut_slice(
data: &mut [u8],
skip: usize,
len: usize,
) -> Result<(Self, Vec<&mut ValidatorStakeInfo>), ProgramError>
pub fn deserialize_mut_slice( data: &mut [u8], skip: usize, len: usize, ) -> Result<(Self, Vec<&mut ValidatorStakeInfo>), ProgramError>
Extracts a slice of ValidatorStakeInfo types from the vec part of the ValidatorList
Sourcepub fn deserialize_vec(
data: &mut [u8],
) -> Result<(Self, BigVec<'_>), ProgramError>
pub fn deserialize_vec( data: &mut [u8], ) -> Result<(Self, BigVec<'_>), ProgramError>
Extracts the validator list into its header and internal BigVec
Trait Implementations§
Source§impl BorshSchema for ValidatorListHeader
impl BorshSchema for ValidatorListHeader
Source§fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
Source§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.
Source§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
Source§impl BorshSerialize for ValidatorListHeader
impl BorshSerialize for ValidatorListHeader
Source§impl Clone for ValidatorListHeader
impl Clone for ValidatorListHeader
Source§fn clone(&self) -> ValidatorListHeader
fn clone(&self) -> ValidatorListHeader
Returns a duplicate 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 ValidatorListHeader
impl Debug for ValidatorListHeader
Source§impl Default for ValidatorListHeader
impl Default for ValidatorListHeader
Source§fn default() -> ValidatorListHeader
fn default() -> ValidatorListHeader
Returns the “default value” for a type. Read more
Source§impl PartialEq for ValidatorListHeader
impl PartialEq for ValidatorListHeader
impl StructuralPartialEq for ValidatorListHeader
Auto Trait Implementations§
impl Freeze for ValidatorListHeader
impl RefUnwindSafe for ValidatorListHeader
impl Send for ValidatorListHeader
impl Sync for ValidatorListHeader
impl Unpin for ValidatorListHeader
impl UnwindSafe for ValidatorListHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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