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, Global>  { ... }
    fn write_batch_into<W>(source: &[Self], target: &mut W)
       where W: ByteWriter { ... }
    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, Global>

Serializes self into a vector of bytes.

fn write_batch_into<W>(source: &[Self], target: &mut W)where W: ByteWriter,

Serializes all elements of the source and writes these bytes into the target.

This method does not write any metadata (e.g. number of serialized elements) into the target.

fn get_size_hint(&self) -> usize

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

The default implementation returns zero.

Implementations on Foreign Types§

source§

impl Serializable for PublicInputs

source§

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,

§

impl Serializable for StoreNode

§

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<B> Serializable for CubeExtension<B>where B: ExtensibleField<3>,

§

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<T> Serializable for &[T]where T: Serializable,

§

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

§

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

§

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

§

impl Serializable for Context

§

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

Serializes self and writes the resulting bytes into the target.

§

impl Serializable for OodFrame

§

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

Serializes self and writes the resulting bytes into the target.

§

impl Serializable for Queries

§

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

Serializes self and writes the resulting bytes into the target.

§

impl Serializable for TraceLayout

§

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

Serializes self and writes the resulting bytes into the target.

§

impl Serializable for FieldExtension

§

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

Serializes self and writes the resulting bytes into the target.

§

impl Serializable for ProofOptions

§

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

Serializes self and writes the resulting bytes into the target.

§

impl Serializable for Commitments

§

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

Serializes self and writes the resulting bytes into the target.

§

impl Serializable for FriProof

§

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

Serializes self and writes the resulting bytes into the target writer.

Implementors§

§

impl Serializable for miden_processor::math::Felt

§

impl Serializable for RpoDigest

source§

impl Serializable for Kernel

source§

impl Serializable for ProgramInfo

source§

impl Serializable for StackInputs

source§

impl Serializable for StackOutputs

§

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

§

impl<T> Serializable for &Vec<T, Global>where T: Serializable,

§

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

§

impl<T> Serializable for Vec<T, Global>where T: Serializable,

§

impl<T, const N: usize> Serializable for &Vec<[T; N], Global>where T: Serializable,

§

impl<T, const N: usize> Serializable for Vec<[T; N], Global>where T: Serializable,