Struct Support

Source
pub struct Support<AccountId> {
    pub total: ExtendedBalance,
    pub voters: Vec<(AccountId, ExtendedBalance)>,
}
Expand description

A structure to demonstrate the phragmen result from the perspective of the candidate, i.e. how much support each candidate is receiving.

This complements the PhragmenResult and is needed to run the equalize post-processing.

This, at the current version, resembles the Exposure defined in the Staking pallet, yet they do not necessarily have to be the same.

Fields§

§total: ExtendedBalance

Total support.

§voters: Vec<(AccountId, ExtendedBalance)>

Support from voters.

Trait Implementations§

Source§

impl<AccountId: Debug> Debug for Support<AccountId>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<AccountId: Default> Default for Support<AccountId>

Source§

fn default() -> Support<AccountId>

Returns the “default value” for a type. Read more
Source§

impl<'de, AccountId> Deserialize<'de> for Support<AccountId>
where AccountId: Deserialize<'de>,

Source§

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<AccountId: PartialEq> PartialEq for Support<AccountId>

Source§

fn eq(&self, other: &Support<AccountId>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<AccountId> Serialize for Support<AccountId>
where AccountId: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<AccountId: Eq> Eq for Support<AccountId>

Source§

impl<AccountId> StructuralPartialEq for Support<AccountId>

Auto Trait Implementations§

§

impl<AccountId> Freeze for Support<AccountId>

§

impl<AccountId> RefUnwindSafe for Support<AccountId>
where AccountId: RefUnwindSafe,

§

impl<AccountId> Send for Support<AccountId>
where AccountId: Send,

§

impl<AccountId> Sync for Support<AccountId>
where AccountId: Sync,

§

impl<AccountId> Unpin for Support<AccountId>
where AccountId: Unpin,

§

impl<AccountId> UnwindSafe for Support<AccountId>
where AccountId: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SaturatedConversion for T

Source§

fn saturated_from<T>(t: T) -> Self
where Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
Source§

fn saturated_into<T>(self) -> T
where Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, S> UniqueSaturatedInto<T> for S
where T: Bounded, S: TryInto<T>,

Source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,