[−][src]Struct core_cbc_casper::VoteCount
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: u32
no: 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.
fn add(self, other: Self) -> Self
[src]
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
fn estimate<U: WeightUnit>(
latest_messages: &LatestMessagesHonest<VoteCount>,
_weights: &Weights<u32, U>
) -> Result<Self, Self::Error>
[src]
latest_messages: &LatestMessagesHonest<VoteCount>,
_weights: &Weights<u32, U>
) -> Result<Self, Self::Error>
impl Hash for VoteCount
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for VoteCount
[src]
fn cmp(&self, other: &VoteCount) -> Ordering
[src]
#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<VoteCount> for VoteCount
[src]
impl PartialOrd<VoteCount> for VoteCount
[src]
fn partial_cmp(&self, other: &VoteCount) -> Option<Ordering>
[src]
fn lt(&self, other: &VoteCount) -> bool
[src]
fn le(&self, other: &VoteCount) -> bool
[src]
fn gt(&self, other: &VoteCount) -> bool
[src]
fn ge(&self, other: &VoteCount) -> bool
[src]
impl Serialize for VoteCount
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for VoteCount
[src]
impl StructuralPartialEq for VoteCount
[src]
impl Zero<VoteCount> for VoteCount
[src]
Auto Trait Implementations
impl RefUnwindSafe for VoteCount
impl Send for VoteCount
impl Sync for VoteCount
impl Unpin for VoteCount
impl UnwindSafe for VoteCount
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,