pub trait CanonicalSerialize {
    fn serialize_with_mode<W: Write>(
        &self,
        writer: W,
        compress: Compress
    ) -> Result<(), SerializationError>; fn serialized_size(&self, compress: Compress) -> usize; fn serialize_compressed<W: Write>(
        &self,
        writer: W
    ) -> Result<(), SerializationError> { ... } fn compressed_size(&self) -> usize { ... } fn serialize_uncompressed<W: Write>(
        &self,
        writer: W
    ) -> Result<(), SerializationError> { ... } fn uncompressed_size(&self) -> usize { ... } }
Expand description

Serializer in little endian format. This trait can be derived if all fields of a struct implement CanonicalSerialize and the derive feature is enabled.

Example

// The `derive` feature must be set for the derivation to work.
use ark_serialize::*;

#[derive(CanonicalSerialize)]
struct TestStruct {
    a: u64,
    b: (u64, (u64, u64)),
}

Required Methods

The general serialize method that takes in customization flags.

Provided Methods

Implementations on Foreign Types

Serializes a BTreeMap as len(map) || key 1 || value 1 || ... || key n || value n.

Serializes a BTreeSet as len(set) || value 1 || value 2 || ... || value n.

Implementors