pub struct DelegationRatio {
pub(crate) parts: u8,
pub(crate) pools: Box<[(PoolId, u8)]>,
}
Expand description
Delegation Ratio type express a number of parts and a list of pools and their individual parts
E.g. parts: 7, pools: [(A,2), (B,1), (C,4)] means that A is associated with 2/7 of the stake, B has 1/7 of stake and C has 4/7 of the stake.
It’s invalid to have less than 2 elements in the array, and by extension parts need to be equal to the sum of individual pools parts.
Fields§
§parts: u8
§pools: Box<[(PoolId, u8)]>
Implementations§
Trait Implementations§
source§impl Arbitrary for DelegationRatio
impl Arbitrary for DelegationRatio
§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = BoxedStrategy<DelegationRatio>
type Strategy = BoxedStrategy<DelegationRatio>
The type of
Strategy
used to generate values of type Self
.source§fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
source§impl Clone for DelegationRatio
impl Clone for DelegationRatio
source§fn clone(&self) -> DelegationRatio
fn clone(&self) -> DelegationRatio
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 DelegationRatio
impl Debug for DelegationRatio
source§impl PartialEq<DelegationRatio> for DelegationRatio
impl PartialEq<DelegationRatio> for DelegationRatio
source§fn eq(&self, other: &DelegationRatio) -> bool
fn eq(&self, other: &DelegationRatio) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for DelegationRatio
impl StructuralEq for DelegationRatio
impl StructuralPartialEq for DelegationRatio
Auto Trait Implementations§
impl RefUnwindSafe for DelegationRatio
impl Send for DelegationRatio
impl Sync for DelegationRatio
impl Unpin for DelegationRatio
impl UnwindSafe for DelegationRatio
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