Skip to main content

Serializable

Trait Serializable 

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§

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.

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 Serializable for str

§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for u8

§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for u16

§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for u32

§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for u64

§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for u128

§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for ()

§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for usize

§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for String

§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for ColumnNumber

§

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

§

impl Serializable for EncryptedData

§

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

§

impl Serializable for EncryptedData

§

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

§

impl Serializable for EphemeralPublicKey

§

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

§

impl Serializable for EphemeralPublicKey

§

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

§

impl Serializable for FileLineCol

§

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

§

impl Serializable for Forest

§

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

§

impl Serializable for Goldilocks

§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for InOrderIndex

§

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

§

impl Serializable for LineNumber

§

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

§

impl Serializable for LineageId

Available on crate feature serde only.
§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for MerkleProof

§

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

§

impl Serializable for NodeMutation

§

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

§

impl Serializable for Nonce

§

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

§

impl Serializable for Nonce

§

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

§

impl Serializable for PartialMmr

§

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

§

impl Serializable for PartialSmt

§

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 SealedMessage

§

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

§

impl Serializable for SealingKey

§

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

§

impl Serializable for SecretKey

§

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

§

impl Serializable for SecretKey

§

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 SourceSpan

§

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

§

impl Serializable for SparseMerklePath

§

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

§

impl Serializable for UnsealingKey

§

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

§

impl Serializable for Uri

§

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

§

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

§

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

§

fn get_size_hint(&self) -> usize

§

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

§

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

§

fn get_size_hint(&self) -> usize

§

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

§

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

§

fn get_size_hint(&self) -> usize

§

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

§

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

§

fn get_size_hint(&self) -> usize

§

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

§

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

§

fn get_size_hint(&self) -> usize

§

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

§

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

§

fn get_size_hint(&self) -> usize

§

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,

§

fn get_size_hint(&self) -> usize

§

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

§

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

§

fn get_size_hint(&self) -> usize

§

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

§

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

§

fn get_size_hint(&self) -> usize

§

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

§

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

§

fn get_size_hint(&self) -> usize

§

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

§

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

§

fn get_size_hint(&self) -> usize

§

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

§

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

§

fn get_size_hint(&self) -> usize

§

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

§

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,

§

fn get_size_hint(&self) -> usize

§

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

§

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

Implementors§

§

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

§

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

§

impl Serializable for &SignatureHeader

§

impl Serializable for &SignaturePoly

Source§

impl Serializable for DebugVarLocation

Source§

impl Serializable for Operation

Source§

impl Serializable for HashFunction

Source§

impl Serializable for AdviceInputs

Source§

impl Serializable for AdviceMap

§

impl Serializable for miden_core::crypto::dsa::ecdsa_k256_keccak::PublicKey

§

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

§

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

§

impl Serializable for miden_core::crypto::dsa::eddsa_25519_sha512::PublicKey

§

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

§

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

§

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

§

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

§

impl Serializable for MerklePath

§

impl Serializable for MerkleStore

§

impl Serializable for Mmr

§

impl Serializable for NodeIndex

§

impl Serializable for PartialMerkleTree

§

impl Serializable for Smt

§

impl Serializable for SmtProof

§

impl Serializable for StoreNode

§

impl Serializable for RandomCoin

Source§

impl Serializable for EventId

Source§

impl Serializable for EventName

Source§

impl Serializable for AsmOpId

Source§

impl Serializable for DebugInfo

Source§

impl Serializable for DebugVarId

Source§

impl Serializable for DecoratorId

Source§

impl Serializable for MastForest

Source§

impl Serializable for DebugVarInfo

Source§

impl Serializable for PrecompileRequest

Source§

impl Serializable for Kernel

Source§

impl Serializable for Program

Source§

impl Serializable for ProgramInfo

Source§

impl Serializable for StackInputs

Source§

impl Serializable for StackOutputs

Source§

impl Serializable for ExecutionProof

§

impl Serializable for Felt

§

impl Serializable for Word

Available on not (target_family=wasm and miden).
§

impl<I, D> Serializable for CsrMatrix<I, D>
where I: Idx, D: Serializable,

§

impl<I, T> Serializable for IndexVec<I, T>
where I: Idx, T: Serializable,

§

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

Available on not (target_family=wasm and miden).
§

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