Trait SerdeBincodeCompat

pub trait SerdeBincodeCompat: Sized + 'static {
    type BincodeRepr<'a>: Debug + Serialize + DeserializeOwned;

    // Required methods
    fn as_repr(&self) -> Self::BincodeRepr<'_>;
    fn from_repr(repr: Self::BincodeRepr<'_>) -> Self;
}
Expand description

Trait for types that can be serialized and deserialized using bincode.

The recommended way to add bincode compatible serialization is via the serde_with crate and the serde_as macro that. See for reference header.

Required Associated Types§

type BincodeRepr<'a>: Debug + Serialize + DeserializeOwned

Serde representation of the type for bincode serialization.

This type defines the bincode compatible serde format for the type.

Required Methods§

fn as_repr(&self) -> Self::BincodeRepr<'_>

Convert this type into its bincode representation

fn from_repr(repr: Self::BincodeRepr<'_>) -> Self

Convert from the bincode representation

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.

Implementations on Foreign Types§

§

impl SerdeBincodeCompat for EthereumTxEnvelope<TxEip4844>

§

type BincodeRepr<'a> = EthereumTxEnvelope<'a>

§

fn as_repr( &self, ) -> <EthereumTxEnvelope<TxEip4844> as SerdeBincodeCompat>::BincodeRepr<'_>

§

fn from_repr( repr: <EthereumTxEnvelope<TxEip4844> as SerdeBincodeCompat>::BincodeRepr<'_>, ) -> EthereumTxEnvelope<TxEip4844>

§

impl SerdeBincodeCompat for OpReceipt

§

type BincodeRepr<'a> = OpReceipt<'a>

§

fn as_repr(&self) -> <OpReceipt as SerdeBincodeCompat>::BincodeRepr<'_>

§

fn from_repr( repr: <OpReceipt as SerdeBincodeCompat>::BincodeRepr<'_>, ) -> OpReceipt

§

impl SerdeBincodeCompat for OpTxEnvelope

§

type BincodeRepr<'a> = OpTxEnvelope<'a>

§

fn as_repr(&self) -> <OpTxEnvelope as SerdeBincodeCompat>::BincodeRepr<'_>

§

fn from_repr( repr: <OpTxEnvelope as SerdeBincodeCompat>::BincodeRepr<'_>, ) -> OpTxEnvelope

§

impl<T, H> SerdeBincodeCompat for Block<T, H>

§

type BincodeRepr<'a> = Block<'a, T, H>

§

fn as_repr(&self) -> <Block<T, H> as SerdeBincodeCompat>::BincodeRepr<'_>

§

fn from_repr( repr: <Block<T, H> as SerdeBincodeCompat>::BincodeRepr<'_>, ) -> Block<T, H>

§

impl<T, H> SerdeBincodeCompat for BlockBody<T, H>

§

type BincodeRepr<'a> = BlockBody<'a, T, H>

§

fn as_repr(&self) -> <BlockBody<T, H> as SerdeBincodeCompat>::BincodeRepr<'_>

§

fn from_repr( repr: <BlockBody<T, H> as SerdeBincodeCompat>::BincodeRepr<'_>, ) -> BlockBody<T, H>

Implementors§