Trait Listener

Source
pub trait Listener<T> {
    // Provided methods
    fn added(&mut self, _tx: &Arc<T>, _old: Option<&Arc<T>>) { ... }
    fn rejected<H: Debug + LowerHex>(
        &mut self,
        _tx: &Arc<T>,
        _reason: &Error<H>,
    ) { ... }
    fn dropped(&mut self, _tx: &Arc<T>, _by: Option<&T>) { ... }
    fn invalid(&mut self, _tx: &Arc<T>) { ... }
    fn canceled(&mut self, _tx: &Arc<T>) { ... }
    fn culled(&mut self, _tx: &Arc<T>) { ... }
}
Expand description

Transaction pool listener.

Listener is being notified about status of every transaction in the pool.

Provided Methods§

Source

fn added(&mut self, _tx: &Arc<T>, _old: Option<&Arc<T>>)

The transaction has been successfully added to the pool. If second argument is Some the transaction has took place of some other transaction which was already in pool. NOTE: You won’t be notified about drop of old transaction separately.

Source

fn rejected<H: Debug + LowerHex>(&mut self, _tx: &Arc<T>, _reason: &Error<H>)

The transaction was rejected from the pool. It means that it was too cheap to replace any transaction already in the pool.

Source

fn dropped(&mut self, _tx: &Arc<T>, _by: Option<&T>)

The transaction was pushed out from the pool because of the limit.

Source

fn invalid(&mut self, _tx: &Arc<T>)

The transaction was marked as invalid by executor.

Source

fn canceled(&mut self, _tx: &Arc<T>)

The transaction has been canceled.

Source

fn culled(&mut self, _tx: &Arc<T>)

The transaction has been culled from the pool.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T, A, B> Listener<T> for (A, B)
where A: Listener<T>, B: Listener<T>,

Source§

fn added(&mut self, tx: &Arc<T>, old: Option<&Arc<T>>)

Source§

fn rejected<H: Debug + LowerHex>(&mut self, tx: &Arc<T>, reason: &Error<H>)

Source§

fn dropped(&mut self, tx: &Arc<T>, by: Option<&T>)

Source§

fn invalid(&mut self, tx: &Arc<T>)

Source§

fn canceled(&mut self, tx: &Arc<T>)

Source§

fn culled(&mut self, tx: &Arc<T>)

Implementors§