Module encoding

Source
Expand description

Consensus encoding Binary encoding interface suitable for consensus critical encoding.

Over time all structs that ! need to be encoded to binary will be migrated to this interface.

This code is based on corresponding rust-bitcoin types.

See Encodable and Decodable for two main traits.

Modules§

as_hex
Serde implementations using hex-encoded encodables
btc

Structs§

BigSize
Lightning TLV uses a custom variable-length integer called BigSize. It is similar to Bitcoin’s variable-length integers except that it is serialized in big-endian instead of little-endian.
CountWrite
A writer counting number of writes written to it
DecodeError
SimpleBitcoinRead

Enums§

DynRawFallback
A type that decodes module_instance_id-prefixed Ts even when corresponding Decoder is not available.

Constants§

MAX_DECODE_SIZE
Maximum size, in bytes, of data we are allowed to ever decode for a single value.

Traits§

Decodable
Data which can be encoded in a consensus-consistent way
DynEncodable
Object-safe trait for things that can encode themselves
Encodable
Data which can be encoded in a consensus-consistent way

Functions§

consensus_decode_bytes
Specialized version of Decodable for bytes
consensus_decode_bytes_from_finite_reader
Specialized version of Decodable for bytes
consensus_decode_bytes_static
Specialized version of Decodable for fixed-size byte arrays
consensus_decode_bytes_static_from_finite_reader
Specialized version of Decodable for fixed-size byte arrays
consensus_encode_bytes
Specialized version of Encodable for bytes
consensus_encode_bytes_static
Specialized version of Encodable for static byte arrays

Derive Macros§

Decodable
Encodable