Trait concordium_std::Serial [−][src]
pub trait Serial {
fn serial<W>(&self, _out: &mut W) -> Result<(), <W as Write>::Err>
where
W: Write;
}Expand description
The Serial trait provides a means of writing structures into byte-sinks
(Write).
Can be derived using #[derive(Serial)] for most cases.
Required methods
fn serial<W>(&self, _out: &mut W) -> Result<(), <W as Write>::Err> where
W: Write, [src]
W: Write,
Expand description
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; 12] where
T: Serial, [src]
impl<T> Serial for [T; 12] where
T: Serial, [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 for [T; 28] where
T: Serial, [src]
impl<T> Serial for [T; 28] where
T: Serial, [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 for [T; 5] where
T: Serial, [src]
impl<T> Serial for [T; 5] where
T: Serial, [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 for [T; 30] where
T: Serial, [src]
impl<T> Serial for [T; 30] where
T: Serial, [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 for [T; 22] where
T: Serial, [src]
impl<T> Serial for [T; 22] where
T: Serial, [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 for [T; 21] where
T: Serial, [src]
impl<T> Serial for [T; 21] where
T: Serial, [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 for [T; 23] where
T: Serial, [src]
impl<T> Serial for [T; 23] where
T: Serial, [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 for [T; 1] where
T: Serial, [src]
impl<T> Serial for [T; 1] where
T: Serial, [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 for [T; 32] where
T: Serial, [src]
impl<T> Serial for [T; 32] where
T: Serial, [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 for [T; 10] where
T: Serial, [src]
impl<T> Serial for [T; 10] where
T: Serial, [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 for [T; 26] where
T: Serial, [src]
impl<T> Serial for [T; 26] where
T: Serial, [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 for [T; 11] where
T: Serial, [src]
impl<T> Serial for [T; 11] where
T: Serial, [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 for [T; 24] where
T: Serial, [src]
impl<T> Serial for [T; 24] where
T: Serial, [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 Serial for bool[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<T> Serial for [T; 13] where
T: Serial, [src]
impl<T> Serial for [T; 13] where
T: Serial, [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 for [T; 7] where
T: Serial, [src]
impl<T> Serial for [T; 7] where
T: Serial, [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 for [T; 20] where
T: Serial, [src]
impl<T> Serial for [T; 20] where
T: Serial, [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 for [T; 27] where
T: Serial, [src]
impl<T> Serial for [T; 27] where
T: Serial, [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 for [T; 17] where
T: Serial, [src]
impl<T> Serial for [T; 17] where
T: Serial, [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 for [T; 16] where
T: Serial, [src]
impl<T> Serial for [T; 16] where
T: Serial, [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 for [T; 2] where
T: Serial, [src]
impl<T> Serial for [T; 2] where
T: Serial, [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 for [T; 25] where
T: Serial, [src]
impl<T> Serial for [T; 25] where
T: Serial, [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 for Option<T> where
T: Serial, [src]
impl<T> Serial for Option<T> where
T: Serial, [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 for [T; 19] where
T: Serial, [src]
impl<T> Serial for [T; 19] where
T: Serial, [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 for [T; 29] where
T: Serial, [src]
impl<T> Serial for [T; 29] where
T: Serial, [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 for [T; 14] where
T: Serial, [src]
impl<T> Serial for [T; 14] where
T: Serial, [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 for [T; 8] where
T: Serial, [src]
impl<T> Serial for [T; 8] where
T: Serial, [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 for [T; 9] where
T: Serial, [src]
impl<T> Serial for [T; 9] where
T: Serial, [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 for [T; 6] where
T: Serial, [src]
impl<T> Serial for [T; 6] where
T: Serial, [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 for [T; 15] where
T: Serial, [src]
impl<T> Serial for [T; 15] where
T: Serial, [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 for [T; 3] where
T: Serial, [src]
impl<T> Serial for [T; 3] where
T: Serial, [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 for [T; 18] where
T: Serial, [src]
impl<T> Serial for [T; 18] where
T: Serial, [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 for [T; 4] where
T: Serial, [src]
impl<T> Serial for [T; 4] where
T: Serial, [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 for [T; 31] where
T: Serial, [src]
impl<T> Serial for [T; 31] where
T: Serial, [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<'_> Serial for &'_ str[src]
impl<'_> Serial for &'_ str[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<_>.
Implementors
impl Serial for SizeLength[src]
impl Serial for SizeLength[src]impl Serial for AccountAddress[src]
impl Serial for AccountAddress[src]impl Serial for AttributeTag[src]
impl Serial for AttributeTag[src]impl Serial for ChainMetadata[src]
impl Serial for ChainMetadata[src]impl Serial for ContractAddress[src]
impl Serial for ContractAddress[src]impl Serial for OwnedContractName[src]
impl Serial for OwnedContractName[src]impl Serial for OwnedReceiveName[src]
impl Serial for OwnedReceiveName[src]impl Serial for String[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 &str.
impl<'a> Serial for ContractName<'a>[src]
impl<'a> Serial for ContractName<'a>[src]impl<'a> Serial for ReceiveName<'a>[src]
impl<'a> Serial for ReceiveName<'a>[src]impl<C> Serial for PhantomData<C> where
C: ?Sized, [src]
impl<C> Serial for PhantomData<C> where
C: ?Sized, [src]impl<K> Serial for BTreeSet<K> where
K: Serial + Ord, [src]
impl<K> Serial for BTreeSet<K> where
K: Serial + Ord, [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)