[−][src]Trait concordium_contracts_common::Serial
The Serial
trait provides a means of writing structures into byte-sinks
(Write
).
Can be derived using #[derive(Serial)]
for most cases.
Required methods
pub fn serial<W: Write>(&self, _out: &mut W) -> Result<(), W::Err>
[src]
Attempt to write the structure into the provided writer, failing if only part of the structure could be written.
NB: We use Result instead of Option for better composability with other constructs.
Implementations on Foreign Types
impl<X: Serial, Y: Serial> Serial for (X, Y)
[src]
impl Serial for u8
[src]
impl Serial for u16
[src]
impl Serial for u32
[src]
impl Serial for u64
[src]
impl Serial for i8
[src]
impl Serial for i16
[src]
impl Serial for i32
[src]
impl Serial for i64
[src]
impl Serial for bool
[src]
Serialization of bool
encodes it as a single byte, false
is represented
by 0u8
and true
is only represented by 1u8
.
impl Serial for String
[src]
Serialized by writing an u32
representing the number of bytes for a
utf8-encoding of the string, then writing the bytes. Similar to Vec<_>
.
impl<T: Serial> Serial for Box<T>
[src]
impl<T: Serial> Serial for Option<T>
[src]
Serialized if the Option
is a None
we write 0u8
. If Some
, we write
1u8
followed by the serialization of the contained T
.
impl<T: Serial> Serial for Vec<T>
[src]
Serialized by writing an u32
representing the number of elements, followed
by the elements serialized according to their type T
.
impl<K: Serial + Ord, V: Serial> Serial for BTreeMap<K, V>
[src]
The serialization of maps encodes their size as a u32. This should be sufficient for all realistic use cases in smart contracts. They are serialized in ascending order.
impl<K: Serial + Ord> Serial for BTreeSet<K>
[src]
The serialization of sets encodes their size as a u32. This should be sufficient for all realistic use cases in smart contracts. They are serialized in canonical order (increasing)
impl<T: Serial> Serial for [T; 1]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 2]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 3]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 4]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 5]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 6]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 7]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 8]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 9]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 10]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 11]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 12]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 13]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 14]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 15]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 16]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 17]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 18]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 19]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 20]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 21]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 22]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 23]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 24]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 25]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 26]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 27]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 28]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 29]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 30]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 31]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.
impl<T: Serial> Serial for [T; 32]
[src]
Serialize the array by writing elements consecutively starting at 0. Since the length of the array is known statically it is not written out explicitly. Thus serialization of the array A and the slice &A[..] differ.