[][src]Trait hbbft::transaction_queue::TransactionQueue

pub trait TransactionQueue<T>: Debug + Default + Extend<T> + Sync + Send {
    fn is_empty(&self) -> bool;
fn choose<R: Rng>(
        &mut self,
        rng: &mut R,
        amount: usize,
        batch_size: usize
    ) -> Vec<T>;
fn remove_multiple<'a, I>(&mut self, txs: I)
    where
        I: IntoIterator<Item = &'a T>,
        T: 'a + Contribution
; }

An interface to the transaction queue. A transaction queue is a structural part of QueueingHoneyBadger that manages enqueueing of transactions for a future batch and dequeueing of transactions to become part of a current batch.

Required methods

fn is_empty(&self) -> bool

Checks whether the queue is empty.

fn choose<R: Rng>(
    &mut self,
    rng: &mut R,
    amount: usize,
    batch_size: usize
) -> Vec<T>

Returns a new set of amount transactions, randomly chosen from the first batch_size. No transactions are removed from the queue.

fn remove_multiple<'a, I>(&mut self, txs: I) where
    I: IntoIterator<Item = &'a T>,
    T: 'a + Contribution

Removes the given transactions from the queue.

Loading content...

Implementations on Foreign Types

impl<T> TransactionQueue<T> for Vec<T> where
    T: Clone + Debug + Sync + Send
[src]

Loading content...

Implementors

Loading content...