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§
Sourcefn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Serializes self
into bytes and writes these bytes into the target
.
Provided Methods§
Sourcefn get_size_hint(&self) -> usize
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
impl Serializable for HashFunction
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Source§impl Serializable for Operation
impl Serializable for Operation
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Source§impl Serializable for BatchingMethod
impl Serializable for BatchingMethod
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
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
impl Serializable for FieldExtension
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
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
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self.
Source§impl Serializable for str
impl Serializable for str
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn get_size_hint(&self) -> usize
Source§impl Serializable for u8
impl Serializable for u8
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn get_size_hint(&self) -> usize
Source§impl Serializable for u16
impl Serializable for u16
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn get_size_hint(&self) -> usize
Source§impl Serializable for u32
impl Serializable for u32
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn get_size_hint(&self) -> usize
Source§impl Serializable for u64
impl Serializable for u64
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn get_size_hint(&self) -> usize
Source§impl Serializable for u128
impl Serializable for u128
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn get_size_hint(&self) -> usize
Source§impl Serializable for ()
impl Serializable for ()
fn write_into<W>(&self, _target: &mut W)where
W: ByteWriter,
fn get_size_hint(&self) -> usize
Source§impl Serializable for 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 String
impl Serializable for String
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn get_size_hint(&self) -> usize
Source§impl Serializable for PublicInputs
impl Serializable for PublicInputs
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Source§impl Serializable for FunctionTypeSerializer<'_>
impl Serializable for FunctionTypeSerializer<'_>
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Source§impl Serializable for TypeSerializer<'_>
impl Serializable for TypeSerializer<'_>
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Source§impl Serializable for Kernel
impl Serializable for Kernel
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Source§impl Serializable for TraceInfo
impl Serializable for TraceInfo
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
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
impl Serializable for ProofOptions
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
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
impl Serializable for Commitments
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
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
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self.
Source§impl Serializable for Context
impl Serializable for Context
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
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
impl Serializable for OodFrame
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
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
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self.
Source§impl Serializable for Queries
impl Serializable for Queries
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
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
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self.
Source§impl Serializable for Proof
impl Serializable for Proof
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Source§impl Serializable for FriProof
impl Serializable for FriProof
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
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
impl Serializable for BaseElement
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn get_size_hint(&self) -> usize
Source§impl Serializable for BaseElement
impl Serializable for BaseElement
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn get_size_hint(&self) -> usize
Source§impl<B> Serializable for CubeExtension<B>where
B: ExtensibleField<3>,
impl<B> Serializable for CubeExtension<B>where
B: ExtensibleField<3>,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Source§impl<B> Serializable for QuadExtension<B>where
B: ExtensibleField<2>,
impl<B> Serializable for QuadExtension<B>where
B: ExtensibleField<2>,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Source§impl<H> Serializable for BatchMerkleProof<H>where
H: Hasher,
impl<H> Serializable for BatchMerkleProof<H>where
H: Hasher,
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
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>where
K: Serializable,
V: Serializable,
impl<K, V> Serializable for BTreeMap<K, V>where
K: Serializable,
V: Serializable,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn get_size_hint(&self) -> usize
Source§impl<T1> Serializable for (T1,)where
T1: Serializable,
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
Source§impl<T1, T2> Serializable for (T1, T2)where
T1: Serializable,
T2: Serializable,
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
Source§impl<T1, T2, T3> Serializable for (T1, T2, T3)
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
Source§impl<T1, T2, T3, T4> Serializable for (T1, T2, T3, T4)
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
Source§impl<T1, T2, T3, T4, T5> Serializable for (T1, T2, T3, T4, T5)
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
Source§impl<T1, T2, T3, T4, T5, T6> Serializable for (T1, T2, T3, T4, T5, T6)where
T1: Serializable,
T2: Serializable,
T3: Serializable,
T4: Serializable,
T5: Serializable,
T6: Serializable,
impl<T1, T2, T3, T4, T5, T6> Serializable for (T1, T2, T3, T4, T5, T6)where
T1: Serializable,
T2: Serializable,
T3: Serializable,
T4: Serializable,
T5: Serializable,
T6: Serializable,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn get_size_hint(&self) -> usize
Source§impl<T> Serializable for Option<T>where
T: Serializable,
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
Source§impl<T> Serializable for &Twhere
T: Serializable,
impl<T> Serializable for &Twhere
T: Serializable,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn get_size_hint(&self) -> usize
Source§impl<T> Serializable for [T]where
T: Serializable,
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
Source§impl<T> Serializable for BTreeSet<T>where
T: Serializable,
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
Source§impl<T> Serializable for Vec<T>where
T: Serializable,
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
Source§impl<T> Serializable for Span<T>where
T: Serializable,
impl<T> Serializable for Span<T>where
T: Serializable,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Source§impl<T, const C: usize> Serializable for [T; C]where
T: Serializable,
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
Implementors§
impl Serializable for &Nonce
impl Serializable for &PubKeyPoly
impl Serializable for &SignatureHeader
impl Serializable for &SignaturePoly
impl Serializable for AuthSecretKey
impl Serializable for FeltRepresentation
impl Serializable for MultiWordRepresentation
impl Serializable for StorageEntry
impl Serializable for WordRepresentation
impl Serializable for AccountUpdateDetails
impl Serializable for AccountId
impl Serializable for AccountIdPrefix
impl Serializable for AccountType
impl Serializable for StorageSlot
impl Serializable for StorageSlotType
impl Serializable for LibraryNamespace
impl Serializable for ModuleKind
impl Serializable for Asset
impl Serializable for NodeMutation
impl Serializable for SmtLeaf
impl Serializable for NoteFile
impl Serializable for NoteTag
impl Serializable for NoteType
impl Serializable for InputNote
impl Serializable for OutputNote
impl Serializable for AccountProcedureInfo
impl Serializable for AccountCode
impl Serializable for AccountComponentMetadata
impl Serializable for AccountComponentTemplate
impl Serializable for FieldIdentifier
impl Serializable for MapEntry
impl Serializable for MapRepresentation
impl Serializable for StorageValueName
impl Serializable for TemplateType
impl Serializable for AccountDelta
impl Serializable for AccountStorageDelta
impl Serializable for AccountVaultDelta
impl Serializable for FungibleAssetDelta
impl Serializable for NonFungibleAssetDelta
impl Serializable for StorageMapDelta
impl Serializable for Account
impl Serializable for AccountFile
impl Serializable for AccountHeader
impl Serializable for AccountIdPrefixV0
impl Serializable for AccountIdV0
impl Serializable for AccountStorage
impl Serializable for AccountStorageHeader
impl Serializable for PartialAccount
impl Serializable for PartialStorage
impl Serializable for PartialStorageMap
impl Serializable for StorageMap
impl Serializable for DecoratorId
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