reth_primitives_traits/serde_bincode_compat.rs
1use core::fmt::Debug;
2
3pub use super::header::{serde_bincode_compat as header, serde_bincode_compat::*};
4use serde::{de::DeserializeOwned, Serialize};
5
6/// Trait for types that can be serialized and deserialized using bincode.
7pub trait SerdeBincodeCompat: Sized + 'static {
8 /// Serde representation of the type for bincode serialization.
9 type BincodeRepr<'a>: Debug + Serialize + DeserializeOwned + From<&'a Self> + Into<Self>;
10}
11
12impl SerdeBincodeCompat for alloy_consensus::Header {
13 type BincodeRepr<'a> = alloy_consensus::serde_bincode_compat::Header<'a>;
14}