[][src]Struct hbbft::Fault

pub struct Fault<N, F: Fail> {
    pub node_id: N,
    pub kind: F,
}

A structure representing the context of a faulty node. This structure describes which node is faulty (node_id) and which faulty behavior that the node exhibited ('kind').

Fields

node_id: N

The faulty node's ID.

kind: F

The kind of fault the node is blamed for.

Methods

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

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

Creates a new fault, blaming node_id for the kind.

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

Applies f_fault to kind, leaves node_id unchanged

Trait Implementations

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: PartialEq, F: PartialEq + Fail> PartialEq<Fault<N, F>> for Fault<N, F>[src]

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

impl<N: Clone, F: Clone + Fail> Clone for Fault<N, F>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<N: Debug, F: Debug + Fail> Debug for Fault<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 Fault<N, F> where
    N: Send

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

Blanket Implementations

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

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

type Owned = T

impl<T> From for 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.