Expand description
Contains serialization and deserialization code for types used throughout the system.
Structs§
- A newtype wrapper for bytes that has efficient serialization routines.
Enums§
- Serialization and deserialization errors.
Constants§
- The number of bytes in a serialized
bool. - The number of bytes in a serialized
i32. - The number of bytes in a serialized
i64. - The tag representing a
Nonevalue. - The tag representing a
Somevalue. - The tag representing an
Errvalue. - The tag representing an
Okvalue. - The number of bytes in a serialized
u8. - The number of bytes in a serialized
u16. - The number of bytes in a serialized
u32. - The number of bytes in a serialized
u64. - The number of bytes in a serialized
U128. - The number of bytes in a serialized
U256. - The number of bytes in a serialized
U512. - The number of bytes in a serialized
().
Traits§
- A type which can be deserialized from a
Vec<u8>. - A type which can be serialized to a
Vec<u8>.
Functions§
- Returns a
Vec<u8>initialized with sufficient capacity to holdto_be_serializedafter serialization, or an error if the capacity would exceedu32::MAX. - Returns a
Vec<u8>initialized with sufficient capacity to holdexpected_sizebytes, or an error if the capacity would exceedu32::max_value(). - Deserializes
bytesinto an instance ofT. - Deserializes a slice of bytes into an instance of
T. - Serializes
tinto aVec<u8>. - test_
serialization_ roundtrip testingAsserts thattcan be serialized and when deserialized back into an instanceTcompares equal tot. - Returns a
Vec<u8>initialized with sufficient capacity to holdto_be_serializedafter serialization.