pub struct VoteAccounts { /* private fields */ }
Implementations§
Source§impl VoteAccounts
impl VoteAccounts
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn staked_nodes(&self) -> Arc<HashMap<Pubkey, u64>>
pub fn get(&self, pubkey: &Pubkey) -> Option<&VoteAccount>
pub fn get_delegated_stake(&self, pubkey: &Pubkey) -> u64
pub fn iter(&self) -> impl Iterator<Item = (&Pubkey, &VoteAccount)>
pub fn delegated_stakes(&self) -> impl Iterator<Item = (&Pubkey, u64)>
pub fn find_max_by_delegated_stake(&self) -> Option<&VoteAccount>
pub fn insert( &mut self, pubkey: Pubkey, new_vote_account: VoteAccount, calculate_stake: impl FnOnce() -> u64, ) -> Option<VoteAccount>
pub fn remove(&mut self, pubkey: &Pubkey) -> Option<(u64, VoteAccount)>
pub fn add_stake(&mut self, pubkey: &Pubkey, delta: u64)
pub fn sub_stake(&mut self, pubkey: &Pubkey, delta: u64)
Trait Implementations§
Source§impl AsRef<HashMap<Pubkey, (u64, VoteAccount)>> for VoteAccounts
impl AsRef<HashMap<Pubkey, (u64, VoteAccount)>> 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§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)>>> for VoteAccounts
impl From<Arc<HashMap<Pubkey, (u64, VoteAccount)>>> 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§impl PartialEq for VoteAccounts
impl PartialEq for VoteAccounts
Auto Trait Implementations§
impl !Freeze for VoteAccounts
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> 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