Module monero::consensus::encode

source ·
Expand description

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

A variable-length unsigned integer type as defined by the Monero codebase.

Enums

Errors encountered when encoding or decoding data.

Traits

Data which can be decoded in a consensus-consistent way.
Data which can be encoded in a consensus-consistent way.
Extensions of io::Read to decode data as per Monero consensus.
Extensions of io::Write to encode data as per Monero consensus.

Functions

Deserialize an object from a byte vector, will error if said deserialization doesn’t consume the entire vector.
Deserialize an object from a vector, but will not report an error if said deserialization doesn’t consume the entire vector.
Encode an object into a vector of byte.
Encode an object into a hex-encoded string.