Trait snarkvm_utilities::serialize::CanonicalDeserialize[][src]

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)),
}

If your code depends on algebra instead, the example works analogously when importing algebra::serialize::*.

Required methods

Reads Self from reader.

Provided methods

Reads Self from reader without compression.

Implementations on Foreign Types

Implementors