Struct spl_stake_pool::state::ValidatorListHeader
source · [−]#[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
sourceimpl 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
sourceimpl BorshDeserialize for ValidatorListHeader where
AccountType: BorshDeserialize,
u32: BorshDeserialize,
impl BorshDeserialize for ValidatorListHeader where
AccountType: BorshDeserialize,
u32: BorshDeserialize,
sourceimpl BorshSchema for ValidatorListHeader where
AccountType: BorshSchema,
u32: BorshSchema,
impl BorshSchema for ValidatorListHeader where
AccountType: BorshSchema,
u32: BorshSchema,
sourcefn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
sourcefn 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. Read more
sourcefn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
Helper method to add a single type definition to the map.
fn schema_container() -> BorshSchemaContainer
sourceimpl BorshSerialize for ValidatorListHeader where
AccountType: BorshSerialize,
u32: BorshSerialize,
impl BorshSerialize for ValidatorListHeader where
AccountType: BorshSerialize,
u32: BorshSerialize,
sourceimpl Clone for ValidatorListHeader
impl Clone for ValidatorListHeader
sourcefn clone(&self) -> ValidatorListHeader
fn clone(&self) -> ValidatorListHeader
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ValidatorListHeader
impl Debug for ValidatorListHeader
sourceimpl Default for ValidatorListHeader
impl Default for ValidatorListHeader
sourcefn default() -> ValidatorListHeader
fn default() -> ValidatorListHeader
Returns the “default value” for a type. Read more
sourceimpl PartialEq<ValidatorListHeader> for ValidatorListHeader
impl PartialEq<ValidatorListHeader> for ValidatorListHeader
sourcefn eq(&self, other: &ValidatorListHeader) -> bool
fn eq(&self, other: &ValidatorListHeader) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ValidatorListHeader) -> bool
fn ne(&self, other: &ValidatorListHeader) -> bool
This method tests for !=.
impl StructuralPartialEq for ValidatorListHeader
Auto Trait Implementations
impl RefUnwindSafe for ValidatorListHeader
impl Send for ValidatorListHeader
impl Sync for ValidatorListHeader
impl Unpin for ValidatorListHeader
impl UnwindSafe for ValidatorListHeader
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more