Trait alloy_network::Network

source ·
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;
    type TransactionRequest: RpcObject + TransactionBuilder<Self> + Debug + From<Self::TxEnvelope> + From<Self::UnsignedTx>;
    type TransactionResponse: RpcObject + TransactionResponse;
    type ReceiptResponse: RpcObject + ReceiptResponse;
    type HeaderResponse: RpcObject;
}
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§

source

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.

source

type TxEnvelope: Eip2718Envelope + Debug

The network transaction envelope type.

source

type UnsignedTx: From<Self::TxEnvelope>

An enum over the various transaction types.

source

type ReceiptEnvelope: Eip2718Envelope + TxReceipt

The network receipt envelope type.

source

type Header

The network header type.

source

type TransactionRequest: RpcObject + TransactionBuilder<Self> + Debug + From<Self::TxEnvelope> + From<Self::UnsignedTx>

The JSON body of a transaction request.

source

type TransactionResponse: RpcObject + TransactionResponse

The JSON body of a transaction response.

source

type ReceiptResponse: RpcObject + ReceiptResponse

The JSON body of a transaction receipt.

source

type HeaderResponse: RpcObject

The JSON body of a header response.

Object Safety§

This trait is not object safe.

Implementors§