Struct solana_runtime::vote_account::VoteAccounts
source · pub struct VoteAccounts {
vote_accounts: Arc<VoteAccountsHashMap>,
staked_nodes: OnceCell<Arc<HashMap<Pubkey, u64>>>,
}
Fields§
§vote_accounts: Arc<VoteAccountsHashMap>
§staked_nodes: OnceCell<Arc<HashMap<Pubkey, u64>>>
Implementations§
source§impl VoteAccounts
impl VoteAccounts
pub(crate) fn len(&self) -> usize
pub fn staked_nodes(&self) -> Arc<HashMap<Pubkey, u64>>
pub(crate) fn get(&self, pubkey: &Pubkey) -> Option<&VoteAccount>
pub fn get_delegated_stake(&self, pubkey: &Pubkey) -> u64
pub(crate) fn iter(&self) -> impl Iterator<Item = (&Pubkey, &VoteAccount)>
pub(crate) fn delegated_stakes(&self) -> impl Iterator<Item = (&Pubkey, u64)>
pub(crate) fn find_max_by_delegated_stake(&self) -> Option<&VoteAccount>
pub(crate) fn insert( &mut self, pubkey: Pubkey, (stake, vote_account): (u64, VoteAccount) )
pub(crate) fn remove(&mut self, pubkey: &Pubkey) -> Option<(u64, VoteAccount)>
pub(crate) fn add_stake(&mut self, pubkey: &Pubkey, delta: u64)
pub(crate) fn sub_stake(&mut self, pubkey: &Pubkey, delta: u64)
fn add_node_stake(&mut self, stake: u64, vote_account: &VoteAccount)
fn sub_node_stake(&mut self, stake: u64, vote_account: &VoteAccount)
Trait Implementations§
source§impl AbiExample for VoteAccounts
impl AbiExample for VoteAccounts
source§impl AsRef<HashMap<Pubkey, (u64, VoteAccount), RandomState>> for VoteAccounts
impl AsRef<HashMap<Pubkey, (u64, VoteAccount), RandomState>> for VoteAccounts
source§fn as_ref(&self) -> &VoteAccountsHashMap
fn as_ref(&self) -> &VoteAccountsHashMap
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for VoteAccounts
impl Clone for VoteAccounts
source§fn clone(&self) -> VoteAccounts
fn clone(&self) -> VoteAccounts
Returns a copy 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 VoteAccounts
impl Debug for VoteAccounts
source§impl Default for VoteAccounts
impl Default for VoteAccounts
source§impl<'de> Deserialize<'de> for VoteAccounts
impl<'de> Deserialize<'de> for VoteAccounts
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<&VoteAccounts> for Arc<VoteAccountsHashMap>
impl From<&VoteAccounts> for Arc<VoteAccountsHashMap>
source§fn from(vote_accounts: &VoteAccounts) -> Self
fn from(vote_accounts: &VoteAccounts) -> Self
Converts to this type from the input type.
source§impl From<Arc<HashMap<Pubkey, (u64, VoteAccount), RandomState>>> for VoteAccounts
impl From<Arc<HashMap<Pubkey, (u64, VoteAccount), RandomState>>> for VoteAccounts
source§fn from(vote_accounts: Arc<VoteAccountsHashMap>) -> Self
fn from(vote_accounts: Arc<VoteAccountsHashMap>) -> Self
Converts to this type from the input type.
source§impl FromIterator<(Pubkey, (u64, VoteAccount))> for VoteAccounts
impl FromIterator<(Pubkey, (u64, VoteAccount))> for VoteAccounts
source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = (Pubkey, (u64, VoteAccount))>,
fn from_iter<I>(iter: I) -> Selfwhere I: IntoIterator<Item = (Pubkey, (u64, VoteAccount))>,
Creates a value from an iterator. Read more
source§impl PartialEq<VoteAccounts> for VoteAccounts
impl PartialEq<VoteAccounts> for VoteAccounts
Auto Trait Implementations§
impl RefUnwindSafe for VoteAccounts
impl Send for VoteAccounts
impl Sync for VoteAccounts
impl Unpin for VoteAccounts
impl UnwindSafe for VoteAccounts
Blanket Implementations§
source§impl<T> AbiEnumVisitor for Twhere
T: Serialize + ?Sized,
impl<T> AbiEnumVisitor for Twhere T: Serialize + ?Sized,
default fn visit_for_abi( &self, _digester: &mut AbiDigester ) -> Result<AbiDigester, DigestError>
source§impl<T> AbiEnumVisitor for Twhere
T: Serialize + AbiExample + ?Sized,
impl<T> AbiEnumVisitor for Twhere T: Serialize + AbiExample + ?Sized,
default fn visit_for_abi( &self, digester: &mut AbiDigester ) -> Result<AbiDigester, DigestError>
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