IntoRpcTx

Trait IntoRpcTx 

pub trait IntoRpcTx<T> {
    type TxInfo;

    // Required method
    fn into_rpc_tx(self, signer: Address, tx_info: Self::TxInfo) -> T;
}
Expand description

Converts self into T. The opposite of FromConsensusTx.

Should create an RPC transaction response object based on a consensus transaction, its signer Address and an additional context IntoRpcTx::TxInfo.

Avoid implementing IntoRpcTx and use FromConsensusTx instead. Implementing it automatically provides an implementation of IntoRpcTx thanks to the blanket implementation in this crate.

Prefer using IntoRpcTx over FromConsensusTx when specifying trait bounds on a generic function to ensure that types that only implement IntoRpcTx can be used as well.

Required Associated Types§

type TxInfo

An additional context, usually TransactionInfo in a wrapper that carries some implementation specific extra information.

Required Methods§

fn into_rpc_tx(self, signer: Address, tx_info: Self::TxInfo) -> T

Performs the conversion consuming self with signer and tx_info. See IntoRpcTx for details.

Implementors§

§

impl<ConsensusTx, RpcTx> IntoRpcTx<RpcTx> for ConsensusTx
where ConsensusTx: Transaction, RpcTx: FromConsensusTx<ConsensusTx>,

§

type TxInfo = <RpcTx as FromConsensusTx<ConsensusTx>>::TxInfo