pub trait CanonicalDeserialize: Sized {
    fn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>;

    fn deserialize_uncompressed<R: Read>(
        reader: &mut R
    ) -> Result<Self, SerializationError> { ... } }
Expand description

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

Example

// The `derive` feature must be set for the derivation to work.
use snarkvm_utilities::serialize::*;
use snarkvm_utilities::errors::SerializationError;

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

Required methods

Reads Self from reader.

Provided methods

Reads Self from reader without compression.

Implementations on Foreign Types

Deserializes a BTreeMap from len(map) || key 1 || value 1 || ... || key n || value n.

Implementors