pub struct PendingPoolMonitor { /* private fields */ }Expand description
Monitors pending transactions and reports status changes.
The monitor maintains a thread-safe set of transaction hashes and
provides a static check_status
method to query a transport for the current state of a transaction.
Implementations§
Source§impl PendingPoolMonitor
impl PendingPoolMonitor
Sourcepub fn new(config: PendingPoolConfig) -> Self
pub fn new(config: PendingPoolConfig) -> Self
Create a new monitor with the given configuration.
Sourcepub fn watch(&self, tx_hash: String) -> bool
pub fn watch(&self, tx_hash: String) -> bool
Add a transaction hash to monitor.
Returns true if the hash was added, false if already present or
if the monitor is at maximum capacity.
Sourcepub fn poll_interval_ms(&self) -> u64
pub fn poll_interval_ms(&self) -> u64
Get the poll interval from the config.
Sourcepub async fn check_status(
transport: &dyn RpcTransport,
tx_hash: &str,
) -> Result<PendingTxStatus, TransportError>
pub async fn check_status( transport: &dyn RpcTransport, tx_hash: &str, ) -> Result<PendingTxStatus, TransportError>
Check the status of a single tx by querying the transport.
Calls eth_getTransactionReceipt on the transport:
Auto Trait Implementations§
impl !Freeze for PendingPoolMonitor
impl RefUnwindSafe for PendingPoolMonitor
impl Send for PendingPoolMonitor
impl Sync for PendingPoolMonitor
impl Unpin for PendingPoolMonitor
impl UnsafeUnpin for PendingPoolMonitor
impl UnwindSafe for PendingPoolMonitor
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