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§

Source§

impl Serializable for Attribute

Source§

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

Source§

impl Serializable for MetaExpr

Source§

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

Source§

impl Serializable for ConstantOp

Source§

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

Source§

impl Serializable for HashKind

Source§

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

Source§

impl Serializable for ConstantValue

Source§

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

Source§

impl Serializable for LibraryExport

NOTE: Deserialization is handled in the implementation for Library

Source§

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

Source§

impl Serializable for IntValue

Source§

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

§

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

Source§

impl Serializable for PublicInputs

Source§

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

Source§

impl Serializable for MetaKeyValue

Source§

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

Source§

impl Serializable for MetaList

Source§

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

Source§

impl Serializable for AttributeSet

Source§

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

Source§

impl Serializable for Ident

Source§

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

Source§

impl Serializable for Path

Source§

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

Source§

impl Serializable for PathBuf

Source§

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

Source§

impl Serializable for KernelLibrary

NOTE: Serialization of libraries is likely to be deprecated in a future release

Source§

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

Source§

impl Serializable for Library

NOTE: Serialization of libraries is likely to be deprecated in a future release

Source§

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

Source§

impl Serializable for WordValue

Source§

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

Source§

impl Serializable for EcdsaRequest

Source§

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

Source§

impl Serializable for EddsaRequest

Source§

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

§

impl Serializable for String

§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for AsmOpId

§

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

§

impl Serializable for ColumnNumber

§

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

§

impl Serializable for DebugInfo

§

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

§

impl Serializable for DebugVarId

§

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

§

impl Serializable for DebugVarInfo

§

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

§

impl Serializable for DebugVarLocation

§

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

§

impl Serializable for DecoratorId

§

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 EventId

§

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

§

impl Serializable for EventName

§

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

§

impl Serializable for Felt

§

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

§

fn get_size_hint(&self) -> usize

§

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 FunctionType

Provides [FunctionType] serialization support via the miden-serde-utils serializer.

This is a temporary implementation to allow type information to be serialized with libraries, but in a future release we’ll either rely on the serde serialization for these types, or provide the serialization implementation in midenc-hir-type instead

§

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 MastForest

§

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

§

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 PrecompileRequest

§

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 Type

Provides [Type] serialization support via the miden-serde-utils serializer.

This is a temporary implementation to allow type information to be serialized with libraries, but in a future release we’ll either rely on the serde serialization for these types, or provide the serialization implementation in midenc-hir-type instead

§

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 LexicographicWord<T>
where T: Into<Word> + Copy,

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

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_vm::crypto::dsa::falcon512_poseidon2::Nonce

§

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

§

impl Serializable for &SignatureHeader

§

impl Serializable for &SignaturePoly

§

impl Serializable for HashFunction

Source§

impl Serializable for ModuleKind

§

impl Serializable for Operation

§

impl Serializable for AdviceInputs

§

impl Serializable for AdviceMap

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

impl Serializable for miden_vm::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

§

impl Serializable for ExecutionProof

§

impl Serializable for Kernel

§

impl Serializable for Program

§

impl Serializable for ProgramInfo

§

impl Serializable for StackInputs

§

impl Serializable for StackOutputs

§

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<const DEPTH: u8> Serializable for LeafIndex<DEPTH>