Trait ark_serialize::CanonicalDeserialize [−][src]
pub trait CanonicalDeserialize: Sized { fn deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>; fn deserialize_uncompressed<R: Read>(
reader: R
) -> Result<Self, SerializationError> { ... } fn deserialize_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)), }
If your code depends on algebra
instead, the example works analogously
when importing algebra::serialize::*
.
Required methods
fn deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
[src]
fn deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
[src]Reads Self
from reader
.
Provided methods
fn deserialize_uncompressed<R: Read>(
reader: R
) -> Result<Self, SerializationError>
[src]
fn deserialize_uncompressed<R: Read>(
reader: R
) -> Result<Self, SerializationError>
[src]Reads Self
from reader
without compression.
fn deserialize_unchecked<R: Read>(reader: R) -> Result<Self, SerializationError>
[src]
fn deserialize_unchecked<R: Read>(reader: R) -> Result<Self, SerializationError>
[src]Reads self
from reader
without compression, and without performing
validity checks. Should be used only when the input is trusted.
Implementations on Foreign Types
impl<'a, T> CanonicalDeserialize for Cow<'a, T> where
T: ToOwned,
<T as ToOwned>::Owned: CanonicalDeserialize,
[src]
impl<'a, T> CanonicalDeserialize for Cow<'a, T> where
T: ToOwned,
<T as ToOwned>::Owned: CanonicalDeserialize,
[src]impl<K, V> CanonicalDeserialize for BTreeMap<K, V> where
K: Ord + CanonicalDeserialize,
V: CanonicalDeserialize,
[src]
impl<K, V> CanonicalDeserialize for BTreeMap<K, V> where
K: Ord + CanonicalDeserialize,
V: CanonicalDeserialize,
[src]Implementors
impl<A, B> CanonicalDeserialize for (A, B) where
A: CanonicalDeserialize,
B: CanonicalDeserialize,
[src]
impl<A, B> CanonicalDeserialize for (A, B) where
A: CanonicalDeserialize,
B: CanonicalDeserialize,
[src]impl<A, B, C> CanonicalDeserialize for (A, B, C) where
A: CanonicalDeserialize,
B: CanonicalDeserialize,
C: CanonicalDeserialize,
[src]
impl<A, B, C> CanonicalDeserialize for (A, B, C) where
A: CanonicalDeserialize,
B: CanonicalDeserialize,
C: CanonicalDeserialize,
[src]impl<A, B, C, D> CanonicalDeserialize for (A, B, C, D) where
A: CanonicalDeserialize,
B: CanonicalDeserialize,
C: CanonicalDeserialize,
D: CanonicalDeserialize,
[src]
impl<A, B, C, D> CanonicalDeserialize for (A, B, C, D) where
A: CanonicalDeserialize,
B: CanonicalDeserialize,
C: CanonicalDeserialize,
D: CanonicalDeserialize,
[src]