pub struct ReputationEntry {
pub authority: AuthorityId,
pub reputation: f64,
pub correct_votes: u64,
pub incorrect_votes: u64,
pub timeouts: u64,
pub byzantine_faults: u64,
pub total_rounds: u64,
}Expand description
Authority reputation entry
Fields§
§reputation: f64§correct_votes: u64§incorrect_votes: u64§timeouts: u64§byzantine_faults: u64§total_rounds: u64Implementations§
Source§impl ReputationEntry
impl ReputationEntry
pub fn new(authority: AuthorityId, initial_reputation: f64) -> Self
Sourcepub fn reliability(&self) -> f64
pub fn reliability(&self) -> f64
Calculate reliability (considering timeouts)
Sourcepub fn is_trustworthy(&self, min_reputation: f64) -> bool
pub fn is_trustworthy(&self, min_reputation: f64) -> bool
Check if authority is trustworthy
Trait Implementations§
Source§impl Clone for ReputationEntry
impl Clone for ReputationEntry
Source§fn clone(&self) -> ReputationEntry
fn clone(&self) -> ReputationEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReputationEntry
impl Debug for ReputationEntry
Source§impl<'de> Deserialize<'de> for ReputationEntry
impl<'de> Deserialize<'de> for ReputationEntry
Source§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
Auto Trait Implementations§
impl Freeze for ReputationEntry
impl RefUnwindSafe for ReputationEntry
impl Send for ReputationEntry
impl Sync for ReputationEntry
impl Unpin for ReputationEntry
impl UnwindSafe for ReputationEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more