Files
nanoreth/crates/primitives-traits/src/block/header.rs
2024-11-14 22:03:09 +00:00

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
{
}