Module monero::consensus::encode [−][src]
Consensus-encodable types and errors.
This represent the core logic for (de)serializing object to conform to Monero consensus.
Essentially, anything that must go on the -disk- or -network- must be encoded using the
Encodable
trait, since this data must be the same for all systems.
The major change with rust-bitcoin
implementation is VarInt
that use the 7 least
significant bits to encode the number and the most significant as a flag if an other byte is
following.
Structs
VarInt | A variable-length unsigned integer type as defined by the Monero codebase. |
Enums
Error | Errors encountered when encoding or decoding data. |
Traits
Decodable | Data which can be decoded in a consensus-consistent way. |
Encodable | Data which can be encoded in a consensus-consistent way. |
ReadExt | Extensions of |
WriteExt | Extensions of |
Functions
deserialize | Deserialize an object from a byte vector, will error if said deserialization doesn’t consume the entire vector. |
deserialize_partial | Deserialize an object from a vector, but will not report an error if said deserialization doesn’t consume the entire vector. |
serialize | Encode an object into a vector of byte. |
serialize_hex | Encode an object into a hex-encoded string. |