ark_serialize

Trait CanonicalDeserialize

Source
pub trait CanonicalDeserialize: Valid {
    // Required method
    fn deserialize_with_mode<R: Read>(
        reader: R,
        compress: Compress,
        validate: Validate,
    ) -> Result<Self, SerializationError>;

    // Provided methods
    fn deserialize_compressed<R: Read>(
        reader: R,
    ) -> Result<Self, SerializationError> { ... }
    fn deserialize_compressed_unchecked<R: Read>(
        reader: R,
    ) -> Result<Self, SerializationError> { ... }
    fn deserialize_uncompressed<R: Read>(
        reader: R,
    ) -> Result<Self, SerializationError> { ... }
    fn deserialize_uncompressed_unchecked<R: Read>(
        reader: 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 ark_serialize::*;

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

Required Methods§

Source

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

The general deserialize method that takes in customization flags.

Provided Methods§

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 CanonicalDeserialize for bool

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl CanonicalDeserialize for u8

Source§

fn deserialize_with_mode<R: Read>( reader: R, _compress: Compress, _validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl CanonicalDeserialize for u16

Source§

fn deserialize_with_mode<R: Read>( reader: R, _compress: Compress, _validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl CanonicalDeserialize for u32

Source§

fn deserialize_with_mode<R: Read>( reader: R, _compress: Compress, _validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl CanonicalDeserialize for u64

Source§

fn deserialize_with_mode<R: Read>( reader: R, _compress: Compress, _validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl CanonicalDeserialize for ()

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl CanonicalDeserialize for usize

Source§

fn deserialize_with_mode<R: Read>( reader: R, _compress: Compress, _validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl CanonicalDeserialize for String

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl CanonicalDeserialize for BigUint

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<'a, T> CanonicalDeserialize for Cow<'a, T>

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<A> CanonicalDeserialize for (A,)

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<A, B> CanonicalDeserialize for (A, B)

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<A, B, C> CanonicalDeserialize for (A, B, C)

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<A, B, C, D> CanonicalDeserialize for (A, B, C, D)

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<A, B, C, D, E> CanonicalDeserialize for (A, B, C, D, E)

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<K, V> CanonicalDeserialize for BTreeMap<K, V>

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

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

Source§

impl<T: Send + Sync> CanonicalDeserialize for PhantomData<T>

Source§

fn deserialize_with_mode<R: Read>( _reader: R, _compress: Compress, _validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<T: CanonicalDeserialize + ToOwned + Sync + Send> CanonicalDeserialize for Arc<T>

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<T: CanonicalDeserialize> CanonicalDeserialize for Option<T>

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<T: CanonicalDeserialize> CanonicalDeserialize for LinkedList<T>

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<T: CanonicalDeserialize> CanonicalDeserialize for VecDeque<T>

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<T: CanonicalDeserialize> CanonicalDeserialize for Vec<T>

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<T: CanonicalDeserialize, const N: usize> CanonicalDeserialize for [T; N]

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

impl<V> CanonicalDeserialize for BTreeSet<V>

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

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

Implementors§