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 &Nonce

§

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

§

impl Serializable for &PublicKey

§

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

§

impl Serializable for &SignatureHeader

§

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

§

impl Serializable for &SignaturePoly

§

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

§

impl Serializable for String

§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for AdviceInputs

§

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

§

impl Serializable for AdviceMap

§

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 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 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 ExecutionProof

§

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 Goldilocks

§

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

§

fn get_size_hint(&self) -> usize

§

impl Serializable for HashFunction

§

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

§

impl Serializable for InOrderIndex

§

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

§

impl Serializable for Kernel

§

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 MerklePath

§

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 MerkleStore

§

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

§

impl Serializable for Mmr

§

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 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 Operation

§

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 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 Program

§

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

§

impl Serializable for ProgramInfo

§

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

§

impl Serializable for PublicKey

§

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

§

impl Serializable for PublicKey

§

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

§

impl Serializable for RandomCoin

§

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 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 SecretKey

§

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 Signature

§

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 Smt

§

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

§

fn get_size_hint(&self) -> usize

§

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 SparseMerklePath

§

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

§

impl Serializable for StackInputs

§

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

§

impl Serializable for StackOutputs

§

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

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<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, 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> Serializable for LeafIndex<DEPTH>

§

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

§

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 Attribute

§

impl Serializable for ConstantOp

§

impl Serializable for ConstantValue

§

impl Serializable for HashKind

§

impl Serializable for MetaExpr

§

impl Serializable for ModuleKind

§

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

§

impl Serializable for LibraryExport

NOTE: Deserialization is handled in the implementation for Library

§

impl Serializable for IntValue

§

impl Serializable for AttributeSet

§

impl Serializable for Ident

§

impl Serializable for MetaKeyValue

§

impl Serializable for MetaList

§

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

§

impl Serializable for AsmOpId

§

impl Serializable for DebugInfo

§

impl Serializable for DebugVarId

§

impl Serializable for DecoratorId

§

impl Serializable for MastForest

§

impl Serializable for KernelLibrary

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

§

impl Serializable for Library

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

§

impl Serializable for Path

§

impl Serializable for PathBuf

§

impl Serializable for SourceSpan

§

impl Serializable for WordValue

§

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 Span<T>
where T: Serializable,