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;
}
Available on crate feature serde-bincode-compat only.
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 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 OpTransactionSigned

§

type BincodeRepr<'a> = OpTransactionSigned<'a>

§

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

§

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

§

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§

§

impl SerdeBincodeCompat for Receipt

§

type BincodeRepr<'a> = Receipt<'a>

§

impl SerdeBincodeCompat for TransactionSigned

§

type BincodeRepr<'a> = TransactionSigned<'a>

§

impl SerdeBincodeCompat for Header

§

type BincodeRepr<'a> = Header<'a>

§

impl<H> SerdeBincodeCompat for SealedHeader<H>
where H: Sealable + SerdeBincodeCompat,

§

type BincodeRepr<'a> = SealedHeader<'a, H>

§

impl<T> SerdeBincodeCompat for ExecutionOutcome<T>

§

impl<T> SerdeBincodeCompat for RecoveredBlock<T>
where T: Block + 'static, <T as Block>::Header: SerdeBincodeCompat, <T as Block>::Body: SerdeBincodeCompat,

§

type BincodeRepr<'a> = RecoveredBlock<'a, T>

§

impl<T> SerdeBincodeCompat for SealedBlock<T>
where T: Block + 'static, <T as Block>::Header: SerdeBincodeCompat, <T as Block>::Body: SerdeBincodeCompat,

§

type BincodeRepr<'a> = SealedBlock<'a, T>