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

Source§

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

Source§

impl Serializable for &SignatureHeader

Source§

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

Source§

impl Serializable for &SignaturePoly

Source§

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

Source§

impl Serializable for &Nonce

Source§

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

Source§

impl Serializable for HashFunction

Source§

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

Source§

impl Serializable for NodeMutation

Source§

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

Source§

impl Serializable for SmtLeaf

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 ExecutionProof

Source§

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

Source§

impl Serializable for PublicInputs

Source§

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

Source§

impl Serializable for AdviceMap

Source§

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

Source§

impl Serializable for DecoratorId

Source§

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

Source§

impl Serializable for SecretKey

Source§

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

Source§

impl Serializable for Signature

Source§

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

Source§

impl Serializable for Forest

Source§

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

Source§

impl Serializable for Mmr

Source§

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

Source§

impl Serializable for InOrderIndex

Source§

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

Source§

impl Serializable for PartialMmr

Source§

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

Source§

impl Serializable for RootPath

Source§

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

Source§

impl Serializable for ValuePath

Source§

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

Source§

impl Serializable for SmtProof

Source§

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

Source§

impl Serializable for Smt

Source§

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

Source§

fn get_size_hint(&self) -> usize

Source§

impl Serializable for PartialSmt

Source§

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

Source§

impl Serializable for SparseMerklePath

Source§

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

Source§

impl Serializable for StoreNode

Source§

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

Source§

impl Serializable for SourceSpan

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

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§