Skip to main content

Module encoding

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_base64
as_hex
Serde implementations using hex-encoded encodables
btc

Structs§

CountWrite
A writer counting number of bytes written to it
DecodeError

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§

decode_field_from_finite_reader
Decodes a field from a finite reader and annotates errors with its schema context.
decode_legacy_option_system_time_from_finite_reader
Decodes an optional timestamp in the legacy SystemTime representation.
decode_legacy_system_time_from_finite_reader
Decodes a timestamp from the legacy (seconds, nanoseconds) representation.
encode_legacy_option_system_time
Encodes an optional timestamp in the legacy SystemTime representation.
encode_legacy_system_time
Encodes a timestamp as the legacy (seconds, nanoseconds) SystemTime representation.
with_decoding_context
Adds schema context to an error returned while decoding a field.

Derive Macros§

Decodable
Encodable