ExecutableTxTuple

Trait ExecutableTxTuple 

Source
pub trait ExecutableTxTuple:
    Into<(Self::IntoIter, Self::Convert)>
    + Send
    + 'static {
    type RawTx: Send + Sync + 'static;
    type Tx: Clone + Send + Sync + 'static;
    type Error: Error + Send + Sync + 'static;
    type IntoIter: IntoParallelIterator<Item = Self::RawTx, Iter: IndexedParallelIterator> + Send + 'static;
    type Convert: Fn(Self::RawTx) -> Result<Self::Tx, Self::Error> + Send + Sync + 'static;
}
Available on crate feature std only.
Expand description

A helper trait representing a pair of a “raw” transactions iterator and a closure that can be used to convert them to an executable transaction. This tuple is used in the engine to parallelize heavy work like decoding or recovery.

Required Associated Types§

Source

type RawTx: Send + Sync + 'static

Raw transaction that can be converted to an ExecutableTxTuple::Tx

This can be any type that can be converted to an ExecutableTxTuple::Tx. For example, an unrecovered transaction or just the transaction bytes.

Source

type Tx: Clone + Send + Sync + 'static

The executable transaction type iterator yields.

Source

type Error: Error + Send + Sync + 'static

Errors that may occur while recovering or decoding transactions.

Source

type IntoIter: IntoParallelIterator<Item = Self::RawTx, Iter: IndexedParallelIterator> + Send + 'static

Iterator over ExecutableTxTuple::Tx.

Source

type Convert: Fn(Self::RawTx) -> Result<Self::Tx, Self::Error> + Send + Sync + 'static

Closure that can be used to convert a ExecutableTxTuple::RawTx to a ExecutableTxTuple::Tx. This might involve heavy work like decoding or recovery and will be parallelized in the engine.

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<RawTx, Tx, Err, I, F> ExecutableTxTuple for (I, F)
where RawTx: Send + Sync + 'static, Tx: Clone + Send + Sync + 'static, Err: Error + Send + Sync + 'static, I: IntoParallelIterator<Item = RawTx, Iter: IndexedParallelIterator> + Send + 'static, F: Fn(RawTx) -> Result<Tx, Err> + Send + Sync + 'static,

Source§

type RawTx = RawTx

Source§

type Tx = Tx

Source§

type Error = Err

Source§

type IntoIter = I

Source§

type Convert = F

Implementors§