Skip to main content

ExecutableTxTuple

Trait ExecutableTxTuple 

Source
pub trait ExecutableTxTuple: 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> + IntoIterator<Item = Self::RawTx> + Send + 'static
       where <Self::IntoIter as IntoParallelIterator>::Iter: IndexedParallelIterator;
    type Convert: ConvertTx<Self::RawTx, Tx = Self::Tx, Error = Self::Error>;

    // Required method
    fn into_parts(self) -> (Self::IntoIter, Self::Convert);
}
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> + IntoIterator<Item = Self::RawTx> + Send + 'static where <Self::IntoIter as IntoParallelIterator>::Iter: IndexedParallelIterator

Iterator over ExecutableTxTuple::Tx.

Source

type Convert: ConvertTx<Self::RawTx, Tx = Self::Tx, Error = Self::Error>

Converter 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.

Required Methods§

Source

fn into_parts(self) -> (Self::IntoIter, Self::Convert)

Decomposes into the raw transaction iterator and converter.

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> + IntoIterator<Item = RawTx> + Send + 'static, <I as IntoParallelIterator>::Iter: IndexedParallelIterator, 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

Source§

fn into_parts(self) -> (I, F)

Implementors§