[−][src]Struct hbbft::broadcast::Broadcast
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]
&mut self,
sender_id: &N,
message: Message
) -> Result<Step<N>>
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.
fn handle_input<R: Rng>(
&mut self,
input: Self::Input,
_rng: &mut R
) -> Result<Step<N>>
[src]
&mut self,
input: Self::Input,
_rng: &mut R
) -> Result<Step<N>>
fn handle_message<R: Rng>(
&mut self,
sender_id: &Self::NodeId,
message: Message,
_rng: &mut R
) -> Result<Step<N>>
[src]
&mut self,
sender_id: &Self::NodeId,
message: Message,
_rng: &mut R
) -> Result<Step<N>>
fn terminated(&self) -> bool
[src]
fn our_id(&self) -> &N
[src]
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,
N: Send + Sync,
impl<N> Sync for Broadcast<N> where
N: Send + Sync,
N: Send + Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,