Trait NetworkPrimitives
pub trait NetworkPrimitives:
Send
+ Sync
+ Unpin
+ Clone
+ Debug
+ PartialEq
+ Eq
+ 'static {
type BlockHeader: BlockHeader + 'static;
type BlockBody: BlockBody + 'static;
type Block: Block<Header = Self::BlockHeader, Body = Self::BlockBody> + Encodable + Decodable + 'static;
type BroadcastedTransaction: SignedTransaction + 'static;
type PooledTransaction: SignedTransaction + TryFrom<Self::BroadcastedTransaction> + 'static;
type Receipt: TxReceipt + RlpEncodableReceipt + RlpDecodableReceipt + Encodable + Decodable + Unpin + 'static;
}
Expand description
Abstraction over primitive types which might appear in network messages. See
[crate::EthMessage
] for more context.
Required Associated Types§
type BlockHeader: BlockHeader + 'static
type BlockHeader: BlockHeader + 'static
The block header type.
type BlockBody: BlockBody + 'static
type BlockBody: BlockBody + 'static
The block body type.
type Block: Block<Header = Self::BlockHeader, Body = Self::BlockBody> + Encodable + Decodable + 'static
type Block: Block<Header = Self::BlockHeader, Body = Self::BlockBody> + Encodable + Decodable + 'static
Full block type.
type BroadcastedTransaction: SignedTransaction + 'static
type BroadcastedTransaction: SignedTransaction + 'static
The transaction type which peers announce in Transactions
messages. It is different from
PooledTransactions
to account for Ethereum case where EIP-4844 transactions are not being
announced and can only be explicitly requested from peers.
type PooledTransaction: SignedTransaction + TryFrom<Self::BroadcastedTransaction> + 'static
type PooledTransaction: SignedTransaction + TryFrom<Self::BroadcastedTransaction> + 'static
The transaction type which peers return in PooledTransactions
messages.
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.