pub trait Serializable: Sized {
    // Required method
    fn write_into<W>(&self, target: &mut W)
       where W: ByteWriter;

    // Provided methods
    fn to_bytes(&self) -> Vec<u8>  { ... }
    fn get_size_hint(&self) -> usize { ... }
}
Expand description

Defines how to serialize Self into bytes.

Required Methods§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

Serializes self into bytes and writes these bytes into the target.

Provided Methods§

fn to_bytes(&self) -> Vec<u8>

Serializes self into a vector of bytes.

fn get_size_hint(&self) -> usize

Returns an estimate of how many bytes are needed to represent self.

The default implementation returns zero.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl Serializable for u8

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for u16

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for u32

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for u64

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for u128

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for ()

§

fn write_into<W>(&self, _target: &mut W)
where W: ByteWriter,

§

impl Serializable for usize

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

source§

impl Serializable for ProgramInfo

source§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

source§

impl Serializable for Kernel

source§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

source§

impl Serializable for StackInputs

source§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

source§

impl Serializable for StackOutputs

source§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for BaseElement

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for BaseElement

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for BaseElement

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for KeyPair

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for MerklePath

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for NodeIndex

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for PartialMerkleTree

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for RootPath

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for RpoDigest

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for RpoRandomCoin

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for RpxDigest

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for Signature

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for SmtLeaf

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for SmtProof

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for StoreNode

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl Serializable for ValuePath

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl<B> Serializable for CubeExtension<B>
where B: ExtensibleField<3>,

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl<B> Serializable for QuadExtension<B>
where B: ExtensibleField<2>,

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl<T1> Serializable for (T1,)
where T1: Serializable,

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl<T1, T2> Serializable for (T1, T2)
where T1: Serializable, T2: Serializable,

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl<T1, T2, T3> Serializable for (T1, T2, T3)

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl<T1, T2, T3, T4> Serializable for (T1, T2, T3, T4)

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl<T1, T2, T3, T4, T5> Serializable for (T1, T2, T3, T4, T5)

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl<T1, T2, T3, T4, T5, T6> Serializable for (T1, T2, T3, T4, T5, T6)

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl<T> Serializable for &Option<T>
where T: Serializable,

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl<T> Serializable for Option<T>
where T: Serializable,

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl<T> Serializable for MerkleStore<T>
where T: KvMap<RpoDigest, StoreNode>,

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl<T, const C: usize> Serializable for [T; C]
where T: Serializable,

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

§

impl<const N: usize> Serializable for Blake3Digest<N>

§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

Implementors§