[−][src]Module monero::consensus::encode
Consensus-encodable types
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 |
Enums
Error | Encoding error |
Traits
Decodable | Data which can be encoded in a consensus-consistent way |
Decoder | A simple Decoder trait |
Encodable | Data which can be encoded in a consensus-consistent way |
Encoder | A simple Encoder trait |
Functions
deserialize | Deserialize an object from a 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 |
serialize_hex | Encode an object into a hex-encoded string |