pub struct Mempool { /* private fields */ }Expand description
A FIFO pool of pending transactions.
Implementations§
Source§impl Mempool
impl Mempool
pub fn new() -> Self
Sourcepub fn submit(&mut self, tx: Transaction)
pub fn submit(&mut self, tx: Transaction)
Submit a transaction into the pool.
Sourcepub fn drain(&mut self, max: usize) -> Vec<Transaction>
pub fn drain(&mut self, max: usize) -> Vec<Transaction>
Remove and return up to max transactions, oldest first.
pub fn pending(&self) -> &[Transaction]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mempool
impl RefUnwindSafe for Mempool
impl Send for Mempool
impl Sync for Mempool
impl Unpin for Mempool
impl UnsafeUnpin for Mempool
impl UnwindSafe for Mempool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more