Serializable

Trait Serializable 

Source
pub trait Serializable {
    // 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§

Source

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

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

Provided Methods§

Source

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

Serializes self into a vector of bytes.

Source

fn get_size_hint(&self) -> usize

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

The default implementation returns zero.

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§

Source§

impl Serializable for NodeMutation

Source§

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

Source§

impl Serializable for SmtLeaf

Source§

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

Source§

impl Serializable for str

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

impl Serializable for u8

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

impl Serializable for u16

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

impl Serializable for u32

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

impl Serializable for u64

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

impl Serializable for u128

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

impl Serializable for ()

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

impl Serializable for usize

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

impl Serializable for String

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

impl Serializable for EncryptedData

Source§

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

Source§

impl Serializable for EncryptedData

Source§

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

Source§

impl Serializable for Nonce

Source§

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

Source§

impl Serializable for SecretKey

Source§

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

Source§

impl Serializable for PublicKey

Source§

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

Source§

impl Serializable for SecretKey

Source§

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

Source§

impl Serializable for Signature

Source§

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

Source§

impl Serializable for EphemeralPublicKey

Source§

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

Source§

impl Serializable for Keccak256Digest

Source§

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

Source§

impl Serializable for Forest

Source§

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

Source§

impl Serializable for InOrderIndex

Source§

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

Source§

impl Serializable for PartialMmr

Source§

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

Source§

impl Serializable for MerkleProof

Source§

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

Source§

impl Serializable for RootPath

Source§

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

Source§

impl Serializable for PartialSmt

Source§

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

Source§

impl Serializable for SparseMerklePath

Source§

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

Source§

impl Serializable for SourceSpan

Source§

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

Source§

impl Serializable for BaseElement

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

impl Serializable for BaseElement

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

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

Source§

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

Source§

impl<H> Serializable for BatchMerkleProof<H>
where H: Hasher,

Source§

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

Writes all internal proof nodes into the provided target.

Source§

impl<K, V> Serializable for BTreeMap<K, V>

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

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

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

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

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

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

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

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

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

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

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

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

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

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

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

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

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

impl<T> Serializable for [T]
where T: Serializable,

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

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

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

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

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

impl<const DEPTH: u8, K, V> Serializable for MutationSet<DEPTH, K, V>
where K: Serializable + Eq + Hash, V: Serializable,

Source§

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

Implementors§

Source§

impl Serializable for &miden_core::crypto::dsa::rpo_falcon512::Nonce

Source§

impl Serializable for &miden_core::crypto::dsa::rpo_falcon512::PublicKey

Source§

impl Serializable for &SignatureHeader

Source§

impl Serializable for &SignaturePoly

Source§

impl Serializable for Operation

Source§

impl Serializable for miden_core::crypto::dsa::rpo_falcon512::SecretKey

Source§

impl Serializable for miden_core::crypto::dsa::rpo_falcon512::Signature

Source§

impl Serializable for MerklePath

Source§

impl Serializable for MerkleStore

Source§

impl Serializable for Mmr

Source§

impl Serializable for NodeIndex

Source§

impl Serializable for PartialMerkleTree

Source§

impl Serializable for Smt

Source§

impl Serializable for SmtProof

Source§

impl Serializable for StoreNode

Source§

impl Serializable for RpoRandomCoin

Source§

impl Serializable for RpxRandomCoin

Source§

impl Serializable for DecoratorId

Source§

impl Serializable for MastForest

Source§

impl Serializable for StackInputs

Source§

impl Serializable for StackOutputs

Source§

impl Serializable for AdviceMap

Source§

impl Serializable for miden_core::Felt

Source§

impl Serializable for Kernel

Source§

impl Serializable for Program

Source§

impl Serializable for ProgramInfo

Source§

impl Serializable for Word

Source§

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

Source§

impl<T> Serializable for LexicographicWord<T>
where T: Into<Word> + Copy,

Source§

impl<const DEPTH: u8> Serializable for LeafIndex<DEPTH>

Source§

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