Enum pallet_democracy::Voting [−][src]
pub enum Voting<Balance, AccountId, BlockNumber> {
Direct {
votes: Vec<(ReferendumIndex, AccountVote<Balance>)>,
delegations: Delegations<Balance>,
prior: PriorLock<BlockNumber, Balance>,
},
Delegating {
balance: Balance,
target: AccountId,
conviction: Conviction,
delegations: Delegations<Balance>,
prior: PriorLock<BlockNumber, Balance>,
},
}Expand description
An indicator for what an account is doing; it can either be delegating or voting.
Variants
The account is voting directly. delegations is the total amount of post-conviction voting
weight that it controls from those that have delegated to it.
Show fields
Fields of Direct
votes: Vec<(ReferendumIndex, AccountVote<Balance>)>The current votes of the account.
delegations: Delegations<Balance>The total amount of delegations that this account has received.
prior: PriorLock<BlockNumber, Balance>Any pre-existing locks from past voting/delegating activity.
The account is delegating balance of its balance to a target account with conviction.
Show fields
Fields of Delegating
balance: Balancetarget: AccountIdconviction: Convictiondelegations: Delegations<Balance>The total amount of delegations that this account has received.
prior: PriorLock<BlockNumber, Balance>Any pre-existing locks from past voting/delegating activity.
Implementations
The amount of this account’s balance that much currently be locked due to voting.
pub fn set_common(
&mut self,
delegations: Delegations<Balance>,
prior: PriorLock<BlockNumber, Balance>
)Trait Implementations
impl<Balance, AccountId, BlockNumber> Decode for Voting<Balance, AccountId, BlockNumber> where
Vec<(ReferendumIndex, AccountVote<Balance>)>: Decode,
Vec<(ReferendumIndex, AccountVote<Balance>)>: Decode,
Delegations<Balance>: Decode,
Delegations<Balance>: Decode,
PriorLock<BlockNumber, Balance>: Decode,
PriorLock<BlockNumber, Balance>: Decode,
Balance: Decode,
Balance: Decode,
AccountId: Decode,
AccountId: Decode,
Delegations<Balance>: Decode,
Delegations<Balance>: Decode,
PriorLock<BlockNumber, Balance>: Decode,
PriorLock<BlockNumber, Balance>: Decode,
impl<Balance, AccountId, BlockNumber> Decode for Voting<Balance, AccountId, BlockNumber> where
Vec<(ReferendumIndex, AccountVote<Balance>)>: Decode,
Vec<(ReferendumIndex, AccountVote<Balance>)>: Decode,
Delegations<Balance>: Decode,
Delegations<Balance>: Decode,
PriorLock<BlockNumber, Balance>: Decode,
PriorLock<BlockNumber, Balance>: Decode,
Balance: Decode,
Balance: Decode,
AccountId: Decode,
AccountId: Decode,
Delegations<Balance>: Decode,
Delegations<Balance>: Decode,
PriorLock<BlockNumber, Balance>: Decode,
PriorLock<BlockNumber, Balance>: Decode, Attempt to deserialise the value from input.
Attempt to skip the encoded value from input. Read more
fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>Returns the fixed encoded size of the type. Read more
impl<Balance, AccountId, BlockNumber> Encode for Voting<Balance, AccountId, BlockNumber> where
Vec<(ReferendumIndex, AccountVote<Balance>)>: Encode,
Vec<(ReferendumIndex, AccountVote<Balance>)>: Encode,
Delegations<Balance>: Encode,
Delegations<Balance>: Encode,
PriorLock<BlockNumber, Balance>: Encode,
PriorLock<BlockNumber, Balance>: Encode,
Balance: Encode,
Balance: Encode,
AccountId: Encode,
AccountId: Encode,
Delegations<Balance>: Encode,
Delegations<Balance>: Encode,
PriorLock<BlockNumber, Balance>: Encode,
PriorLock<BlockNumber, Balance>: Encode,
impl<Balance, AccountId, BlockNumber> Encode for Voting<Balance, AccountId, BlockNumber> where
Vec<(ReferendumIndex, AccountVote<Balance>)>: Encode,
Vec<(ReferendumIndex, AccountVote<Balance>)>: Encode,
Delegations<Balance>: Encode,
Delegations<Balance>: Encode,
PriorLock<BlockNumber, Balance>: Encode,
PriorLock<BlockNumber, Balance>: Encode,
Balance: Encode,
Balance: Encode,
AccountId: Encode,
AccountId: Encode,
Delegations<Balance>: Encode,
Delegations<Balance>: Encode,
PriorLock<BlockNumber, Balance>: Encode,
PriorLock<BlockNumber, Balance>: Encode, Convert self to a slice and append it to the destination.
fn using_encoded<R, F>(&self, f: F) -> R where
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> R where
F: FnOnce(&[u8]) -> R, Convert self to a slice and then invoke the given closure with it.
fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usizeCalculates the encoded size. Read more
impl<Balance, AccountId, BlockNumber> EncodeLike<Voting<Balance, AccountId, BlockNumber>> for Voting<Balance, AccountId, BlockNumber> where
Vec<(ReferendumIndex, AccountVote<Balance>)>: Encode,
Vec<(ReferendumIndex, AccountVote<Balance>)>: Encode,
Delegations<Balance>: Encode,
Delegations<Balance>: Encode,
PriorLock<BlockNumber, Balance>: Encode,
PriorLock<BlockNumber, Balance>: Encode,
Balance: Encode,
Balance: Encode,
AccountId: Encode,
AccountId: Encode,
Delegations<Balance>: Encode,
Delegations<Balance>: Encode,
PriorLock<BlockNumber, Balance>: Encode,
PriorLock<BlockNumber, Balance>: Encode, impl<Balance, AccountId, BlockNumber> StructuralPartialEq for Voting<Balance, AccountId, BlockNumber>Auto Trait Implementations
impl<Balance, AccountId, BlockNumber> RefUnwindSafe for Voting<Balance, AccountId, BlockNumber> where
AccountId: RefUnwindSafe,
Balance: RefUnwindSafe,
BlockNumber: RefUnwindSafe, impl<Balance, AccountId, BlockNumber> Send for Voting<Balance, AccountId, BlockNumber> where
AccountId: Send,
Balance: Send,
BlockNumber: Send, impl<Balance, AccountId, BlockNumber> Sync for Voting<Balance, AccountId, BlockNumber> where
AccountId: Sync,
Balance: Sync,
BlockNumber: Sync, impl<Balance, AccountId, BlockNumber> Unpin for Voting<Balance, AccountId, BlockNumber> where
AccountId: Unpin,
Balance: Unpin,
BlockNumber: Unpin, impl<Balance, AccountId, BlockNumber> UnwindSafe for Voting<Balance, AccountId, BlockNumber> where
AccountId: UnwindSafe,
Balance: UnwindSafe,
BlockNumber: UnwindSafe, Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any, Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = TShould always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> boolChecks if self is actually part of its subset T (and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SSUse with care! Same as self.to_subset but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SPThe inclusion map: converts self to the equivalent element of its superset.
The counterpart to unchecked_from.
Consume self to return an equivalent value of T.
pub fn vzip(self) -> Vimpl<'_, '_, T> EncodeLike<&'_ &'_ T> for T where
T: Encode, impl<'_, T> EncodeLike<&'_ T> for T where
T: Encode, impl<'_, T> EncodeLike<&'_ mut T> for T where
T: Encode, impl<T> EncodeLike<Arc<T>> for T where
T: Encode, impl<T> EncodeLike<Rc<T>> for T where
T: Encode, impl<T> MaybeDebug for T where
T: Debug, impl<T> MaybeDebug for T where
T: Debug,