pub struct Mempool {
pub txs: HashMap<TxHash, MempoolTx>,
accounts: HashMap<Address, AccountNonceAndTransactions>,
}
Fields§
§txs: HashMap<TxHash, MempoolTx>
§accounts: HashMap<Address, AccountNonceAndTransactions>
Implementations§
Source§impl Mempool
impl Mempool
pub fn new() -> Mempool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn is_tx(&self, tx_hash: &TxHash) -> bool
pub fn add_tx(&mut self, tx: Transaction) -> &mut Self
pub fn add_tx_logs(&mut self, tx_hash: TxHash, logs: Vec<Log>) -> &mut Self
pub fn add_tx_state_change( &mut self, tx_hash: TxHash, state_update: GethStateUpdate, ) -> &mut Self
pub fn filter_by_gas_price(&self, gas_price: u128) -> Vec<&MempoolTx>
pub fn filter_ok_by_gas_price(&self, gas_price: u128) -> Vec<&MempoolTx>
pub fn filter_on_block(&self, block_number: BlockNumber) -> Vec<&MempoolTx>
pub fn is_mined(&self, tx_hash: &TxHash) -> bool
pub fn is_failed(&self, tx_hash: &TxHash) -> bool
pub fn clean(&mut self)
pub fn clean_txs( &mut self, max_block_number: BlockNumber, max_time: DateTime<Utc>, )
pub fn set_mined( &mut self, tx_hash: TxHash, block_number: BlockNumber, ) -> &mut Self
pub fn set_failed(&mut self, tx_hash: TxHash)
pub fn set_nonce(&mut self, account: Address, nonce: u64) -> &mut Self
pub fn is_valid_tx(&self, tx: &Transaction) -> bool
pub fn get_tx_by_hash(&self, tx_hash: &TxHash) -> Option<&MempoolTx>
pub fn get_or_fetch_pre_state( &mut self, _tx_hash: &TxHash, ) -> Result<FetchState<GethStateUpdate>>
pub fn remove_tx(&mut self, tx_hash: &TxHash) -> Option<MempoolTx>
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 96 bytes