mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
52 lines
1.0 KiB
Rust
52 lines
1.0 KiB
Rust
//! Block header data primitive.
|
|
|
|
use crate::InMemorySize;
|
|
use alloy_primitives::Sealable;
|
|
use core::fmt;
|
|
use reth_codecs::Compact;
|
|
|
|
/// Helper trait that unifies all behaviour required by block header to support full node
|
|
/// operations.
|
|
pub trait FullBlockHeader: BlockHeader + Compact {}
|
|
|
|
impl<T> FullBlockHeader for T where T: BlockHeader + Compact {}
|
|
|
|
/// Abstraction of a block header.
|
|
pub trait BlockHeader:
|
|
Send
|
|
+ Sync
|
|
+ Unpin
|
|
+ Clone
|
|
+ Default
|
|
+ fmt::Debug
|
|
+ PartialEq
|
|
+ Eq
|
|
+ alloy_rlp::Encodable
|
|
+ alloy_rlp::Decodable
|
|
+ alloy_consensus::BlockHeader
|
|
+ Sealable
|
|
+ InMemorySize
|
|
+ 'static
|
|
{
|
|
}
|
|
|
|
impl<T> BlockHeader for T where
|
|
T: Send
|
|
+ Sync
|
|
+ Unpin
|
|
+ Clone
|
|
+ Default
|
|
+ fmt::Debug
|
|
+ PartialEq
|
|
+ Eq
|
|
+ serde::Serialize
|
|
+ for<'de> serde::Deserialize<'de>
|
|
+ alloy_rlp::Encodable
|
|
+ alloy_rlp::Decodable
|
|
+ alloy_consensus::BlockHeader
|
|
+ Sealable
|
|
+ InMemorySize
|
|
+ 'static
|
|
{
|
|
}
|