[][src]Struct tendermint::trust_threshold::TrustThresholdFraction

pub struct TrustThresholdFraction {
    pub numerator: u64,
    pub denominator: u64,
}

TrustThresholdFraction defines what fraction of the total voting power of a known and trusted validator set is sufficient for a commit to be accepted going forward. The Default::default() returns true, iff at least a third of the trusted voting power signed (in other words at least one honest validator signed). Some clients might require more than +1/3 and can implement their own TrustThreshold which can be passed into all relevant methods.

Fields

numerator: u64

Numerator of the trust threshold fraction

denominator: u64

Numerator of the trust threshold fraction

Implementations

impl TrustThresholdFraction[src]

pub const TWO_THIRDS: Self[src]

Constant for a trust threshold of 2/3.

pub fn new(numerator: u64, denominator: u64) -> Option<Self>[src]

Instantiate a TrustThresholdFraction if the given denominator and numerator are valid.

The parameters are valid iff 1/3 <= numerator/denominator <= 1. In any other case we return None.

Trait Implementations

impl Clone for TrustThresholdFraction[src]

impl Copy for TrustThresholdFraction[src]

impl Debug for TrustThresholdFraction[src]

impl Default for TrustThresholdFraction[src]

impl<'de> Deserialize<'de> for TrustThresholdFraction[src]

impl Display for TrustThresholdFraction[src]

impl Eq for TrustThresholdFraction[src]

impl PartialEq<TrustThresholdFraction> for TrustThresholdFraction[src]

impl Serialize for TrustThresholdFraction[src]

impl StructuralEq for TrustThresholdFraction[src]

impl StructuralPartialEq for TrustThresholdFraction[src]

impl TrustThreshold for TrustThresholdFraction[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> Conv for T

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

impl<T> FmtForward for T

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

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

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> TryConv for T

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,