pub trait Network:
Debug
+ Clone
+ Copy
+ Sized
+ Send
+ Sync
+ 'static {
type TxType: Into<u8> + PartialEq + Eq + TryFrom<u8, Error = Eip2718Error> + Debug + Display + Clone + Copy + Send + Sync + 'static;
type TxEnvelope: Eip2718Envelope + Debug;
type UnsignedTx: From<Self::TxEnvelope>;
type ReceiptEnvelope: Eip2718Envelope + TxReceipt;
type Header: BlockHeader;
type TransactionRequest: RpcObject + TransactionBuilder<Self> + Debug + From<Self::TxEnvelope> + From<Self::UnsignedTx>;
type TransactionResponse: RpcObject + TransactionResponse;
type ReceiptResponse: RpcObject + ReceiptResponse;
type HeaderResponse: RpcObject + HeaderResponse;
type BlockResponse: RpcObject + BlockResponse<Transaction = Self::TransactionResponse, Header = Self::HeaderResponse>;
}
Expand description
Captures type info for network-specific RPC requests/responses.
Networks are only containers for types, so it is recommended to use ZSTs for their definition.
Required Associated Types§
sourcetype TxType: Into<u8> + PartialEq + Eq + TryFrom<u8, Error = Eip2718Error> + Debug + Display + Clone + Copy + Send + Sync + 'static
type TxType: Into<u8> + PartialEq + Eq + TryFrom<u8, Error = Eip2718Error> + Debug + Display + Clone + Copy + Send + Sync + 'static
The network transaction type enum.
This should be a simple #[repr(u8)]
enum, and as such has strict type
bounds for better use in error messages, assertions etc.
sourcetype TxEnvelope: Eip2718Envelope + Debug
type TxEnvelope: Eip2718Envelope + Debug
The network transaction envelope type.
sourcetype UnsignedTx: From<Self::TxEnvelope>
type UnsignedTx: From<Self::TxEnvelope>
An enum over the various transaction types.
sourcetype ReceiptEnvelope: Eip2718Envelope + TxReceipt
type ReceiptEnvelope: Eip2718Envelope + TxReceipt
The network receipt envelope type.
sourcetype Header: BlockHeader
type Header: BlockHeader
The network header type.
sourcetype TransactionRequest: RpcObject + TransactionBuilder<Self> + Debug + From<Self::TxEnvelope> + From<Self::UnsignedTx>
type TransactionRequest: RpcObject + TransactionBuilder<Self> + Debug + From<Self::TxEnvelope> + From<Self::UnsignedTx>
The JSON body of a transaction request.
sourcetype TransactionResponse: RpcObject + TransactionResponse
type TransactionResponse: RpcObject + TransactionResponse
The JSON body of a transaction response.
sourcetype ReceiptResponse: RpcObject + ReceiptResponse
type ReceiptResponse: RpcObject + ReceiptResponse
The JSON body of a transaction receipt.
sourcetype HeaderResponse: RpcObject + HeaderResponse
type HeaderResponse: RpcObject + HeaderResponse
The JSON body of a header response.
sourcetype BlockResponse: RpcObject + BlockResponse<Transaction = Self::TransactionResponse, Header = Self::HeaderResponse>
type BlockResponse: RpcObject + BlockResponse<Transaction = Self::TransactionResponse, Header = Self::HeaderResponse>
The JSON body of a block response.
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.