pub struct Staking {
pub summary: DelegatorSummary,
pub delegations: Vec<Delegation>,
pub pending: Vec<PendingWithdrawal>,
pub rewards: Dec,
}Expand description
One account’s stake.
Fields§
§summary: DelegatorSummary§delegations: Vec<Delegation>§pending: Vec<PendingWithdrawal>The newest withdrawals still queued, as many as the summary counts.
rewards: DecRewards over the last REWARDS_WINDOW_MS.
Implementations§
Source§impl Staking
impl Staking
pub fn new( network: Network, summary: DelegatorSummary, delegations: Vec<Delegation>, rewards: &[Reward], history: &[StakeEvent], now_ms: u64, ) -> Staking
Sourcepub fn total(&self) -> Option<Dec>
pub fn total(&self) -> Option<Dec>
Everything staked: delegated, the staking balance, and what is on its way out, which is the account’s until it lands in spot.
Sourcepub fn delegation(&self, validator: Address) -> Option<&Delegation>
pub fn delegation(&self, validator: Address) -> Option<&Delegation>
The delegation to validator, if any.
Trait Implementations§
impl Eq for Staking
impl StructuralPartialEq for Staking
Auto Trait Implementations§
impl Freeze for Staking
impl RefUnwindSafe for Staking
impl Send for Staking
impl Sync for Staking
impl Unpin for Staking
impl UnsafeUnpin for Staking
impl UnwindSafe for Staking
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.