#[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<'a>(
big_vec: &'a mut BigVec<'_>,
skip: usize,
len: usize,
) -> Result<&'a mut [ValidatorStakeInfo], ProgramError>
pub fn deserialize_mut_slice<'a>( big_vec: &'a mut BigVec<'_>, skip: usize, len: usize, ) -> Result<&'a 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 BorshDeserialize for ValidatorListHeader
impl BorshDeserialize for ValidatorListHeader
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
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 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 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 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