pub trait TransactionQueue<T>:
Debug
+ Default
+ Extend<T>
+ Sync
+ Send {
// Required methods
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;
}Expand description
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§
Sourcefn choose<R: Rng>(
&mut self,
rng: &mut R,
amount: usize,
batch_size: usize,
) -> Vec<T>
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.
Sourcefn remove_multiple<'a, I>(&mut self, txs: I)
fn remove_multiple<'a, I>(&mut self, txs: I)
Removes the given transactions from the queue.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".