Struct chain_impl_mockchain::stake::StakeDistribution
source · pub struct StakeDistribution {
pub unassigned: Stake,
pub dangling: Stake,
pub to_pools: HashMap<PoolId, PoolStakeInformation>,
}
Expand description
Stake distribution at a given time.
Mainly containing the value associated with each pool, but in future could also contains:
Fields§
§unassigned: Stake
§dangling: Stake
§to_pools: HashMap<PoolId, PoolStakeInformation>
For each stake pool, the total stake value, and the value for the stake pool members.
Implementations§
source§impl StakeDistribution
impl StakeDistribution
pub fn get_total_stake(&self) -> Stake
source§impl StakeDistribution
impl StakeDistribution
pub fn empty() -> Self
sourcepub fn eligible_stake_pools(&self) -> usize
pub fn eligible_stake_pools(&self) -> usize
Return the number of stake pools with non-zero stake.
sourcepub fn total_stake(&self) -> Stake
pub fn total_stake(&self) -> Stake
Return the total stake held by the eligible stake pools.
pub fn get_stake_for(&self, poolid: &PoolId) -> Option<Stake>
pub fn get_distribution( &self, pool_id: &PoolId ) -> Option<&PoolStakeInformation>
Trait Implementations§
source§impl Clone for StakeDistribution
impl Clone for StakeDistribution
source§fn clone(&self) -> StakeDistribution
fn clone(&self) -> StakeDistribution
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 StakeDistribution
impl Debug for StakeDistribution
source§impl PartialEq<StakeDistribution> for StakeDistribution
impl PartialEq<StakeDistribution> for StakeDistribution
source§fn eq(&self, other: &StakeDistribution) -> bool
fn eq(&self, other: &StakeDistribution) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for StakeDistribution
impl StructuralEq for StakeDistribution
impl StructuralPartialEq for StakeDistribution
Auto Trait Implementations§
impl RefUnwindSafe for StakeDistribution
impl Send for StakeDistribution
impl Sync for StakeDistribution
impl Unpin for StakeDistribution
impl UnwindSafe for StakeDistribution
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