Skip to main content

ConvertTx

Trait ConvertTx 

pub trait ConvertTx<RawTx>:
    Send
    + Sync
    + 'static {
    type Tx;
    type Error;

    // Required method
    fn convert(&self, raw: RawTx) -> Result<Self::Tx, Self::Error>;
}
Available on crate feature std only.
Expand description

Converts a raw transaction into an executable transaction.

This trait abstracts the conversion logic (e.g., decoding, signature recovery) that is parallelized in the engine.

Required Associated Types§

type Tx

The executable transaction type.

type Error

Errors that may occur during conversion.

Required Methods§

fn convert(&self, raw: RawTx) -> Result<Self::Tx, Self::Error>

Converts a raw transaction.

Implementations on Foreign Types§

§

impl<A, B, RA, RB> ConvertTx<Either<RA, RB>> for Either<A, B>
where A: ConvertTx<RA>, B: ConvertTx<RB>,

§

type Tx = Either<<A as ConvertTx<RA>>::Tx, <B as ConvertTx<RB>>::Tx>

§

type Error = Either<<A as ConvertTx<RA>>::Error, <B as ConvertTx<RB>>::Error>

§

fn convert( &self, raw: Either<RA, RB>, ) -> Result<<Either<A, B> as ConvertTx<Either<RA, RB>>>::Tx, <Either<A, B> as ConvertTx<Either<RA, RB>>>::Error>

Implementors§

§

impl<F, RawTx, Tx, Err> ConvertTx<RawTx> for F
where F: Fn(RawTx) -> Result<Tx, Err> + Send + Sync + 'static,

§

type Tx = Tx

§

type Error = Err