IntoRpcTx

Trait IntoRpcTx 

Source
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§

Source

type TxInfo

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

Required Methods§

Source

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§

Source§

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

Source§

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