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 HashFunction

Source§

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

Source§

impl Serializable for Operation

Source§

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

Source§

impl Serializable for BatchingMethod

Source§

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

Serializes self and writes the resulting bytes into the target.

Source§

impl Serializable for FieldExtension

Source§

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

Serializes self and writes the resulting bytes into the target.

Source§

fn get_size_hint(&self) -> usize

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

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 PublicInputs

Source§

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

Source§

impl Serializable for FunctionTypeSerializer<'_>

Source§

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

Source§

impl Serializable for TypeSerializer<'_>

Source§

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

Source§

impl Serializable for Kernel

Source§

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

Source§

impl Serializable for TraceInfo

Source§

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

Serializes self and writes the resulting bytes into the target.

Source§

impl Serializable for ProofOptions

Source§

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

Serializes self and writes the resulting bytes into the target.

Source§

impl Serializable for Commitments

Source§

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

Serializes self and writes the resulting bytes into the target.

Source§

fn get_size_hint(&self) -> usize

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

Source§

impl Serializable for Context

Source§

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

Serializes self and writes the resulting bytes into the target.

Source§

impl Serializable for OodFrame

Source§

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

Serializes self and writes the resulting bytes into the target.

Source§

fn get_size_hint(&self) -> usize

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

Source§

impl Serializable for Queries

Source§

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

Serializes self and writes the resulting bytes into the target.

Source§

fn get_size_hint(&self) -> usize

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

Source§

impl Serializable for Proof

Source§

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

Source§

impl Serializable for FriProof

Source§

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

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

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<B> Serializable for QuadExtension<B>
where B: ExtensibleField<2>,

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

Implementors§

Source§

impl Serializable for &Nonce

Source§

impl Serializable for &PubKeyPoly

Source§

impl Serializable for &SignatureHeader

Source§

impl Serializable for &SignaturePoly

Source§

impl Serializable for AuthSecretKey

Source§

impl Serializable for FeltRepresentation

Source§

impl Serializable for MultiWordRepresentation

Source§

impl Serializable for StorageEntry

Source§

impl Serializable for WordRepresentation

Source§

impl Serializable for AccountUpdateDetails

Source§

impl Serializable for AccountId

Source§

impl Serializable for AccountIdPrefix

Source§

impl Serializable for AccountType

Source§

impl Serializable for StorageSlot

Source§

impl Serializable for StorageSlotType

Source§

impl Serializable for LibraryNamespace

Source§

impl Serializable for ModuleKind

Source§

impl Serializable for Asset

Source§

impl Serializable for NodeMutation

Source§

impl Serializable for SmtLeaf

Source§

impl Serializable for NoteFile

Source§

impl Serializable for NoteTag

Source§

impl Serializable for NoteType

Source§

impl Serializable for InputNote

Source§

impl Serializable for OutputNote

Source§

impl Serializable for AccountProcedureInfo

Source§

impl Serializable for AccountCode

Source§

impl Serializable for AccountComponentMetadata

Source§

impl Serializable for AccountComponentTemplate

Source§

impl Serializable for FieldIdentifier

Source§

impl Serializable for MapEntry

Source§

impl Serializable for MapRepresentation

Source§

impl Serializable for StorageValueName

Source§

impl Serializable for TemplateType

Source§

impl Serializable for AccountDelta

Source§

impl Serializable for AccountStorageDelta

Source§

impl Serializable for AccountVaultDelta

Source§

impl Serializable for FungibleAssetDelta

Source§

impl Serializable for NonFungibleAssetDelta

Source§

impl Serializable for StorageMapDelta

Source§

impl Serializable for Account

Source§

impl Serializable for AccountFile

Source§

impl Serializable for AccountHeader

Source§

impl Serializable for AccountIdPrefixV0

Source§

impl Serializable for AccountIdV0

Source§

impl Serializable for AccountStorage

Source§

impl Serializable for AccountStorageHeader

Source§

impl Serializable for PartialAccount

Source§

impl Serializable for PartialStorage

Source§

impl Serializable for PartialStorageMap

Source§

impl Serializable for StorageMap

Source§

impl Serializable for DecoratorId

Source§

impl Serializable for KernelLibrary

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

Source§

impl Serializable for Library

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

Source§

impl Serializable for LibraryPath

Source§

impl Serializable for ProcedureName

Source§

impl Serializable for QualifiedProcedureName

Source§

impl Serializable for SourceSpan

Source§

impl Serializable for AssetVault

Source§

impl Serializable for FungibleAsset

Source§

impl Serializable for NonFungibleAsset

Source§

impl Serializable for PartialVault

Source§

impl Serializable for BatchAccountUpdate

Source§

impl Serializable for BatchId

Source§

impl Serializable for BatchNoteTree

Source§

impl Serializable for OrderedBatches

Source§

impl Serializable for ProposedBatch

Source§

impl Serializable for ProvenBatch

Source§

impl Serializable for AccountTree

Source§

impl Serializable for AccountUpdateWitness

Source§

impl Serializable for AccountWitness

Source§

impl Serializable for BlockAccountUpdate

Source§

impl Serializable for BlockHeader

Source§

impl Serializable for BlockNoteTree

Source§

impl Serializable for BlockNumber

Source§

impl Serializable for Blockchain

Source§

impl Serializable for FeeParameters

Source§

impl Serializable for NullifierTree

Source§

impl Serializable for NullifierWitness

Source§

impl Serializable for ProposedBlock

Source§

impl Serializable for ProvenBlock

Source§

impl Serializable for SecretKey

Source§

impl Serializable for Signature

Source§

impl Serializable for Forest

Source§

impl Serializable for InOrderIndex

Source§

impl Serializable for MerklePath

Source§

impl Serializable for Mmr

Source§

impl Serializable for NodeIndex

Source§

impl Serializable for PartialMerkleTree

Source§

impl Serializable for PartialMmr

Source§

impl Serializable for PartialSmt

Source§

impl Serializable for RootPath

Source§

impl Serializable for Smt

Source§

impl Serializable for SmtProof

Source§

impl Serializable for SparseMerklePath

Source§

impl Serializable for StoreNode

Source§

impl Serializable for ValuePath

Source§

impl Serializable for RpoRandomCoin

Source§

impl Serializable for RpxRandomCoin

Source§

impl Serializable for Note

Source§

impl Serializable for NoteAssets

Source§

impl Serializable for NoteDetails

Source§

impl Serializable for NoteHeader

Source§

impl Serializable for NoteId

Source§

impl Serializable for NoteInclusionProof

Source§

impl Serializable for NoteInputs

Source§

impl Serializable for NoteLocation

Source§

impl Serializable for NoteMetadata

Source§

impl Serializable for NoteRecipient

Source§

impl Serializable for NoteScript

Source§

impl Serializable for Nullifier

Source§

impl Serializable for PartialNote

Source§

impl Serializable for miden_objects::Felt

Source§

impl Serializable for MastForest

Source§

impl Serializable for Word

Source§

impl Serializable for AccountInputs

Source§

impl Serializable for ExecutedTransaction

Source§

impl Serializable for InputNoteCommitment

Source§

impl Serializable for OrderedTransactionHeaders

Source§

impl Serializable for OutputNotes

Source§

impl Serializable for PartialBlockchain

Source§

impl Serializable for ProvenTransaction

Source§

impl Serializable for TransactionArgs

Source§

impl Serializable for TransactionHeader

Source§

impl Serializable for TransactionId

Source§

impl Serializable for TransactionInputs

Source§

impl Serializable for TransactionMeasurements

Source§

impl Serializable for TransactionOutputs

Source§

impl Serializable for TransactionScript

Source§

impl Serializable for TransactionSummary

Source§

impl Serializable for TransactionWitness

Source§

impl Serializable for TxAccountUpdate

Source§

impl Serializable for AdviceInputs

Source§

impl Serializable for AdviceMap

Source§

impl Serializable for ExecutionProof

Source§

impl Serializable for Program

Source§

impl Serializable for ProgramInfo

Source§

impl Serializable for StackInputs

Source§

impl Serializable for StackOutputs

Source§

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

Source§

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

Source§

impl<T: Serializable> Serializable for InputNotes<T>

Source§

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

Source§

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

Source§

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