[][src]Struct hbbft::FaultLog

pub struct FaultLog<N, F: Fail>(pub Vec<Fault<N, F>>);

A structure used to contain reports of faulty node behavior.

Methods

impl<N, F> FaultLog<N, F> where
    F: Fail
[src]

pub fn new() -> Self[src]

Creates an empty FaultLog.

pub fn init(node_id: N, kind: F) -> Self[src]

Creates a new FaultLog initialized with a single log.

pub fn append(&mut self, node_id: N, kind: F)[src]

Creates a new Fault and pushes it onto the fault log.

pub fn append_fault(&mut self, fault: Fault<N, F>)[src]

Consumes a Fault and pushes it onto the fault log.

pub fn extend(&mut self, new_logs: FaultLog<N, F>)[src]

Consumes new_logs, appending its logs onto the end of self.

pub fn merge_into(self, logs: &mut FaultLog<N, F>)[src]

Consumes self, appending its logs onto the end of logs.

pub fn is_empty(&self) -> bool[src]

Returns true if there are no fault entries in the log.

pub fn map<F2, FF>(self, f_fault: FF) -> FaultLog<N, F2> where
    F2: Fail,
    FF: Fn(F) -> F2, 
[src]

Applies f_fault to each element in log, modifying its kind only

Trait Implementations

impl<M, O, N, F> From<FaultLog<N, F>> for Step<M, O, N, F> where
    F: Fail
[src]

impl<N, F> IntoIterator for FaultLog<N, F> where
    F: Fail
[src]

type Item = Fault<N, F>

The type of the elements being iterated over.

type IntoIter = IntoIter<Fault<N, F>>

Which kind of iterator are we turning this into?

impl<N, F> Into<FaultLog<N, F>> for Fault<N, F> where
    F: Fail
[src]

Creates a new FaultLog where self is the first element in the log vector.

impl<N, F> Default for FaultLog<N, F> where
    F: Fail
[src]

impl<N: PartialEq, F: PartialEq + Fail> PartialEq<FaultLog<N, F>> for FaultLog<N, F>[src]

impl<N: Debug, F: Debug + Fail> Debug for FaultLog<N, F>[src]

impl<N, F> FromIterator<Fault<N, F>> for FaultLog<N, F> where
    F: Fail
[src]

Auto Trait Implementations

impl<N, F> Send for FaultLog<N, F> where
    N: Send

impl<N, F> Sync for FaultLog<N, F> where
    N: Sync

Blanket Implementations

impl<T> From for T[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.