Trait concordium_std::Serial [−][src]
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>(&self, _out: &mut W) -> Result<(), <W as Write>::Err> where
W: Write, [src]
W: Write,
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<T> Serial for [T; 3] where
T: Serial, [src]
T: Serial,
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 for [T; 30] where
T: Serial, [src]
T: Serial,
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 Serial for u32[src]
impl<T> Serial for [T; 27] where
T: Serial, [src]
T: Serial,
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 Serial for u8[src]
impl Serial for u16[src]
impl<T> Serial for [T; 9] where
T: Serial, [src]
T: Serial,
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 Serial for i8[src]
impl<T> Serial for [T; 15] where
T: Serial, [src]
T: Serial,
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 Serial for u64[src]
impl<T> Serial for [T; 31] where
T: Serial, [src]
T: Serial,
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 Serial for i64[src]
impl<T> Serial for [T; 19] where
T: Serial, [src]
T: Serial,
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 for [T; 21] where
T: Serial, [src]
T: Serial,
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 for [T; 22] where
T: Serial, [src]
T: Serial,
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 for Box<T, Global> where
T: Serial, [src]
T: Serial,
impl<T> Serial for [T; 24] where
T: Serial, [src]
T: Serial,
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 for [T; 23] where
T: Serial, [src]
T: Serial,
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 for [T; 12] where
T: Serial, [src]
T: Serial,
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 for [T; 6] where
T: Serial, [src]
T: Serial,
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 for [T; 18] where
T: Serial, [src]
T: Serial,
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 for [T; 17] where
T: Serial, [src]
T: Serial,
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 for [T; 29] where
T: Serial, [src]
T: Serial,
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 for [T; 2] where
T: Serial, [src]
T: Serial,
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 for [T; 20] where
T: Serial, [src]
T: Serial,
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 for [T; 7] where
T: Serial, [src]
T: Serial,
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 for [T; 8] where
T: Serial, [src]
T: Serial,
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 for [T; 10] where
T: Serial, [src]
T: Serial,
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 Serial for i32[src]
impl<T> Serial for [T; 4] where
T: Serial, [src]
T: Serial,
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 for [T; 25] where
T: Serial, [src]
T: Serial,
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 for [T; 16] where
T: Serial, [src]
T: Serial,
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 for [T; 14] where
T: Serial, [src]
T: Serial,
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 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<T> Serial for [T; 11] where
T: Serial, [src]
T: Serial,
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 for [T; 13] where
T: Serial, [src]
T: Serial,
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 for Option<T> where
T: Serial, [src]
T: Serial,
Serialized if the Option is a None we write 0u8. If Some, we write
1u8 followed by the serialization of the contained T.
impl Serial for i16[src]
impl<T> Serial for [T; 28] where
T: Serial, [src]
T: Serial,
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 for [T; 26] where
T: Serial, [src]
T: Serial,
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 for [T; 5] where
T: Serial, [src]
T: Serial,
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 for [T; 1] where
T: Serial, [src]
T: Serial,
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 for [T; 32] where
T: Serial, [src]
T: Serial,
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<X, Y> Serial for (X, Y) where
Y: Serial,
X: Serial, [src]
Loading content...Y: Serial,
X: Serial,
Implementors
impl Serial for Address[src]
impl Serial for Fields[src]
impl Serial for SizeLength[src]
impl Serial for Type[src]
impl Serial for Contract[src]
impl Serial for Module[src]
impl Serial for AccountAddress[src]
impl Serial for Amount[src]
impl Serial for AttributeTag[src]
impl Serial for ChainMetadata[src]
impl Serial for ContractAddress[src]
impl Serial for Duration[src]
impl Serial for Policy<Vec<(AttributeTag, Vec<u8, Global>), Global>>[src]
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 Serial for Timestamp[src]
impl<C> Serial for PhantomData<C> where
C: ?Sized, [src]
C: ?Sized,
impl<K> Serial for BTreeSet<K> where
K: Serial + Ord, [src]
K: Serial + Ord,
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<K, V> Serial for BTreeMap<K, V> where
K: Serial + Ord,
V: Serial, [src]
K: Serial + Ord,
V: Serial,
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<T> Serial for Vec<T, Global> where
T: Serial, [src]
T: Serial,
Serialized by writing an u32 representing the number of elements, followed
by the elements serialized according to their type T.