[][src]Struct core_cbc_casper::VoteCount

pub struct VoteCount {
    pub yes: u32,
    pub no: u32,
}

This structure represents votes count values. It implements the Estimator trait. Its purpose is to have a simple type (but complex enough) for the different tests and examples of this crate.

Example

use core_cbc_casper::VoteCount;

assert_eq!(
    *VoteCount::create_vote_message(0, true).estimate(),
    VoteCount { yes: 1, no: 0 },
);

Fields

yes: u32no: u32

Methods

impl VoteCount[src]

pub fn toggled_vote(self) -> Self[src]

pub fn create_vote_message(validator: u32, vote: bool) -> Message<Self>[src]

Creates a new empty vote message, issued by the validator with no justification

Trait Implementations

impl Add<VoteCount> for VoteCount[src]

type Output = Self

The resulting type after applying the + operator.

impl Clone for VoteCount[src]

impl Copy for VoteCount[src]

impl Debug for VoteCount[src]

impl Default for VoteCount[src]

impl Eq for VoteCount[src]

impl Estimator for VoteCount[src]

type ValidatorName = u32

type Error = Error

impl Hash for VoteCount[src]

impl Ord for VoteCount[src]

impl PartialEq<VoteCount> for VoteCount[src]

impl PartialOrd<VoteCount> for VoteCount[src]

impl Serialize for VoteCount[src]

impl StructuralEq for VoteCount[src]

impl StructuralPartialEq for VoteCount[src]

impl Zero<VoteCount> for VoteCount[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.