pub struct TrustThresholdFraction { /* private fields */ }
Expand description
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.
Implementations
Constant for a trust threshold of 2/3.
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 an error.
The denominator of this fraction.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for TrustThresholdFraction
impl Send for TrustThresholdFraction
impl Sync for TrustThresholdFraction
impl Unpin for TrustThresholdFraction
impl UnwindSafe for TrustThresholdFraction
Blanket Implementations
Mutably borrows from an owned value. Read more