Struct tetsy_transaction_pool::Pool[][src]

pub struct Pool<T: VerifiedTransaction, S: Scoring<T>, L = NoopListener> { /* fields omitted */ }
Expand description

A transaction pool.

Implementations

Creates a new Pool with given options and default Scoring and Listener.

Creates a new Pool with given Scoring and options.

Creates new Pool with given Scoring, Listener and options.

Attempts to import new transaction to the pool, returns a Arc<T> or an Error.

NOTE: Since Readyness is separate from the pool it’s possible to import stalled transactions. It’s the caller responsibility to make sure that’s not the case.

NOTE: The transaction may push out some other transactions from the pool either because of limits (see Options) or because Scoring decides that the transaction replaces an existing transaction from that sender.

If any limit is reached the transaction with the lowest Score will be compared with the new transaction via the supplied ShouldReplace implementation and may be evicted.

The Listener will be informed on any drops or rejections.

Clears pool from all transactions. This causes a listener notification that all transactions were dropped. NOTE: the drop-notification order will be arbitrary.

Removes single transaction from the pool. Depending on the is_invalid flag the listener will either get a cancelled or invalid notification.

Removes all stalled transactions from given sender list (or from all senders).

Returns a transaction if it’s part of the pool or None otherwise.

Returns worst transaction in the queue (if any).

Returns true if the pool is at it’s capacity.

Returns senders ordered by priority of their transactions.

Returns an iterator of pending (ready) transactions.

Returns pending (ready) transactions from given sender.

Returns unprioritized list of ready transactions.

Update score of transactions of a particular sender.

Computes the full status of the pool (including readiness).

Returns light status of the pool.

Returns current pool options.

Borrows listener instance.

Borrows scoring instance.

Borrows listener mutably.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.