Struct spl_stake_pool::state::ValidatorList
source · [−]#[repr(C)]pub struct ValidatorList {
pub header: ValidatorListHeader,
pub validators: Vec<ValidatorStakeInfo>,
}Expand description
Storage list for all validator stake accounts in the pool.
Fields
header: ValidatorListHeaderData outside of the validator list, separated out for cheaper deserializations
validators: Vec<ValidatorStakeInfo>List of stake info for each validator in the pool
Implementations
sourceimpl ValidatorList
impl ValidatorList
sourcepub fn new(max_validators: u32) -> Self
pub fn new(max_validators: u32) -> Self
Create an empty instance containing space for max_validators and preferred validator keys
sourcepub fn calculate_max_validators(buffer_length: usize) -> usize
pub fn calculate_max_validators(buffer_length: usize) -> usize
Calculate the number of validator entries that fit in the provided length
sourcepub fn contains(&self, vote_account_address: &Pubkey) -> bool
pub fn contains(&self, vote_account_address: &Pubkey) -> bool
Check if contains validator with particular pubkey
sourcepub fn find_mut(
&mut self,
vote_account_address: &Pubkey
) -> Option<&mut ValidatorStakeInfo>
pub fn find_mut(
&mut self,
vote_account_address: &Pubkey
) -> Option<&mut ValidatorStakeInfo>
Check if contains validator with particular pubkey
sourcepub fn find(&self, vote_account_address: &Pubkey) -> Option<&ValidatorStakeInfo>
pub fn find(&self, vote_account_address: &Pubkey) -> Option<&ValidatorStakeInfo>
Check if contains validator with particular pubkey
sourcepub fn has_active_stake(&self) -> bool
pub fn has_active_stake(&self) -> bool
Check if the list has any active stake
Trait Implementations
sourceimpl BorshDeserialize for ValidatorList where
ValidatorListHeader: BorshDeserialize,
Vec<ValidatorStakeInfo>: BorshDeserialize,
impl BorshDeserialize for ValidatorList where
ValidatorListHeader: BorshDeserialize,
Vec<ValidatorStakeInfo>: BorshDeserialize,
sourceimpl BorshSchema for ValidatorList where
ValidatorListHeader: BorshSchema,
Vec<ValidatorStakeInfo>: BorshSchema,
impl BorshSchema for ValidatorList where
ValidatorListHeader: BorshSchema,
Vec<ValidatorStakeInfo>: 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 ValidatorList where
ValidatorListHeader: BorshSerialize,
Vec<ValidatorStakeInfo>: BorshSerialize,
impl BorshSerialize for ValidatorList where
ValidatorListHeader: BorshSerialize,
Vec<ValidatorStakeInfo>: BorshSerialize,
sourceimpl Clone for ValidatorList
impl Clone for ValidatorList
sourcefn clone(&self) -> ValidatorList
fn clone(&self) -> ValidatorList
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 ValidatorList
impl Debug for ValidatorList
sourceimpl Default for ValidatorList
impl Default for ValidatorList
sourcefn default() -> ValidatorList
fn default() -> ValidatorList
Returns the “default value” for a type. Read more
sourceimpl PartialEq<ValidatorList> for ValidatorList
impl PartialEq<ValidatorList> for ValidatorList
sourcefn eq(&self, other: &ValidatorList) -> bool
fn eq(&self, other: &ValidatorList) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ValidatorList) -> bool
fn ne(&self, other: &ValidatorList) -> bool
This method tests for !=.
impl StructuralPartialEq for ValidatorList
Auto Trait Implementations
impl RefUnwindSafe for ValidatorList
impl Send for ValidatorList
impl Sync for ValidatorList
impl Unpin for ValidatorList
impl UnwindSafe for ValidatorList
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