[][src]Trait concordium_std::Deserial

pub trait Deserial {
    pub fn deserial<R>(_source: &mut R) -> Result<Self, ParseError>
    where
        R: Read
; }

The Deserial trait provides a means of reading structures from byte-sinks (Read).

Can be derived using #[derive(Deserial)] for most cases.

Required methods

pub fn deserial<R>(_source: &mut R) -> Result<Self, ParseError> where
    R: Read
[src]

Attempt to read a structure from a given source, failing if an error occurs during deserialization or reading.

Loading content...

Implementations on Foreign Types

impl<T> Deserial for [T; 14] where
    T: Deserial
[src]

impl<T> Deserial for [T; 15] where
    T: Deserial
[src]

impl<T> Deserial for [T; 19] where
    T: Deserial
[src]

impl Deserial for String[src]

Deserial by reading an u32 representing the number of bytes, then takes that number of bytes and tries to decode using utf8.

impl<T> Deserial for [T; 8] where
    T: Deserial
[src]

impl Deserial for i8[src]

impl<T> Deserial for [T; 18] where
    T: Deserial
[src]

impl<T> Deserial for Box<T, Global> where
    T: Deserial
[src]

impl<T> Deserial for [T; 12] where
    T: Deserial
[src]

impl<T> Deserial for [T; 5] where
    T: Deserial
[src]

impl Deserial for u16[src]

impl<T> Deserial for [T; 20] where
    T: Deserial
[src]

impl<X, Y> Deserial for (X, Y) where
    X: Deserial,
    Y: Deserial
[src]

impl Deserial for u8[src]

impl<T> Deserial for [T; 23] where
    T: Deserial
[src]

impl Deserial for i16[src]

impl<T> Deserial for [T; 31] where
    T: Deserial
[src]

impl Deserial for bool[src]

Deserializing a bool reads one byte, and returns the value false if the byte is 0u8 and true if the byte is 1u8, every other value results in an error.

impl<T> Deserial for [T; 10] where
    T: Deserial
[src]

impl<T> Deserial for [T; 2] where
    T: Deserial
[src]

impl<T> Deserial for Option<T> where
    T: Deserial
[src]

Deserial by reading one byte, where 0u8 represents None and 1u8 represents Some, every other value results in an error. In the case of Some we deserialize using the contained T.

impl<T> Deserial for [T; 26] where
    T: Deserial
[src]

impl<T> Deserial for [T; 3] where
    T: Deserial
[src]

impl<T> Deserial for [T; 27] where
    T: Deserial
[src]

impl<T> Deserial for [T; 11] where
    T: Deserial
[src]

impl<T> Deserial for [T; 16] where
    T: Deserial
[src]

impl<T> Deserial for [T; 13] where
    T: Deserial
[src]

impl Deserial for i64[src]

impl Deserial for i32[src]

impl Deserial for u32[src]

impl<T> Deserial for [T; 22] where
    T: Deserial
[src]

impl<T> Deserial for Vec<T, Global> where
    T: Deserial
[src]

Deserialized by reading an u32 representing the number of elements, then deserializing that many elements of type T.

impl<T> Deserial for [T; 25] where
    T: Deserial
[src]

impl<T> Deserial for [T; 29] where
    T: Deserial
[src]

impl<T> Deserial for [T; 6] where
    T: Deserial
[src]

impl<T> Deserial for [T; 1] where
    T: Deserial
[src]

impl<T> Deserial for [T; 21] where
    T: Deserial
[src]

impl<T> Deserial for [T; 28] where
    T: Deserial
[src]

impl<T> Deserial for [T; 24] where
    T: Deserial
[src]

impl<T> Deserial for [T; 9] where
    T: Deserial
[src]

impl<T> Deserial for [T; 7] where
    T: Deserial
[src]

impl<T> Deserial for [T; 17] where
    T: Deserial
[src]

impl Deserial for u64[src]

impl<T> Deserial for [T; 30] where
    T: Deserial
[src]

impl<T> Deserial for [T; 32] where
    T: Deserial
[src]

impl<T> Deserial for [T; 4] where
    T: Deserial
[src]

Loading content...

Implementors

impl Deserial for Address[src]

impl Deserial for Fields[src]

impl Deserial for SizeLength[src]

impl Deserial for Type[src]

impl Deserial for Contract[src]

impl Deserial for Module[src]

impl Deserial for AccountAddress[src]

impl Deserial for Amount[src]

impl Deserial for AttributeTag[src]

impl Deserial for ChainMetadata[src]

impl Deserial for ContractAddress[src]

impl Deserial for Duration[src]

impl Deserial for Policy<Vec<(AttributeTag, Vec<u8, Global>), Global>>[src]

impl Deserial for Timestamp[src]

impl<K> Deserial for BTreeSet<K> where
    K: Deserial + Ord
[src]

The deserialization of sets assumes their size as a u32.

WARNING: Deserialization does not ensure the ordering of the keys, it only ensures that there are no duplicates. Serializing a BTreeSet via its Serial instance will lay out elements by the increasing order. As a consequence deserializing, and serializing back is in general not the identity. This could have consequences if the data is hashed, or the byte representation is used in some other way directly. In those cases the a canonical order should be ensured to avoid subtle, difficult to diagnose, bugs.

impl<K, V> Deserial for BTreeMap<K, V> where
    K: Deserial + Ord,
    V: Deserial
[src]

The deserialization of maps assumes their size as a u32.

WARNING: Deserialization does not ensure the ordering of the keys, it only ensures that there are no duplicates. Serializing a BTreeMap via its Serial instance will lay out elements by the increasing order of keys. As a consequence deserializing, and serializing back is in general not the identity. This could have consequences if the data is hashed, or the byte representation is used in some other way directly. In those cases the a canonical order should be ensured to avoid subtle, difficult to diagnose, bugs.

Loading content...