[][src]Struct hbbft::broadcast::Broadcast

pub struct Broadcast<N> { /* fields omitted */ }

Broadcast algorithm instance.

Methods

impl<N: NodeIdT> Broadcast<N>[src]

pub fn new(netinfo: Arc<NetworkInfo<N>>, proposer_id: N) -> Result<Self>[src]

Creates a new broadcast instance to be used by node our_id which expects a value proposal from node proposer_id.

pub fn broadcast(&mut self, input: Vec<u8>) -> Result<Step<N>>[src]

Initiates the broadcast. This must only be called in the proposer node.

pub fn handle_message(
    &mut self,
    sender_id: &N,
    message: Message
) -> Result<Step<N>>
[src]

Handles a message received from sender_id.

This must be called with every message we receive from another node.

pub fn proposer_id(&self) -> &N[src]

Returns the proposer's node ID.

Trait Implementations

impl<N: NodeIdT> ConsensusProtocol for Broadcast<N>[src]

type NodeId = N

Unique node identifier.

type Input = Vec<u8>

The input provided by the user.

type Output = Self::Input

The output type. Some algorithms return an output exactly once, others return multiple times. Read more

type Message = Message

The messages that need to be exchanged between the instances in the participating nodes.

type Error = Error

The errors that can occur during execution.

type FaultKind = FaultKind

The kinds of message faults that can be detected during execution.

impl<N: NodeIdT> Display for Broadcast<N>[src]

impl<N: Debug> Debug for Broadcast<N>[src]

Auto Trait Implementations

impl<N> Send for Broadcast<N> where
    N: Send + Sync

impl<N> Sync for Broadcast<N> where
    N: Send + Sync

Blanket Implementations

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

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

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.