[][src]Struct hbbft::honey_badger::Batch

pub struct Batch<C, N> {
    pub epoch: u64,
    pub contributions: BTreeMap<N, C>,
}

A batch of contributions the algorithm has output.

Fields

epoch: u64

This batch's epoch number. Each epoch produces exactly one batch.

contributions: BTreeMap<N, C>

The set of agreed contributions, by the contributor's node ID.

Methods

impl<C, N: NodeIdT> Batch<C, N>[src]

pub fn iter<'a>(&'a self) -> impl Iterator<Item = <&'a C as IntoIterator>::Item> where
    &'a C: IntoIterator
[src]

Returns an iterator over references to all transactions included in the batch.

pub fn into_tx_iter(self) -> impl Iterator<Item = <C as IntoIterator>::Item> where
    C: IntoIterator
[src]

Returns an iterator over all transactions included in the batch. Consumes the batch.

pub fn len<T>(&self) -> usize where
    C: AsRef<[T]>, 
[src]

Returns the number of transactions in the batch (without detecting duplicates).

pub fn is_empty<T>(&self) -> bool where
    C: AsRef<[T]>, 
[src]

Returns true if the batch contains no transactions.

Trait Implementations

impl<C, N> SenderQueueableOutput<N, u64> for Batch<C, N> where
    C: Contribution,
    N: NodeIdT
[src]

impl<C: Clone, N: Clone> Clone for Batch<C, N>[src]

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

Performs copy-assignment from source. Read more

impl<C: Debug, N: Debug> Debug for Batch<C, N>[src]

Auto Trait Implementations

impl<C, N> Send for Batch<C, N> where
    C: Send,
    N: Send

impl<C, N> Sync for Batch<C, N> where
    C: Sync,
    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.