Module scale

Source
Expand description

This module exposes some utilities for working with SCALE bit sequences, namely:

The Decoder enum can also return the expected number of bytes to be decoded and the number of bits to be returned without actually decoding them.

Re-exports§

pub use format::Format;

Modules§

format
Types to describe the format of some SCALE encoded bits.

Structs§

Decoder
This is handed back from decode_using_format_from, and can be used to obtain some information about, or iterate over, the SCALE encoded bit sequence, using the Format given. Alternately, you can match on it to retrieve a decoder for the specific format, which may be more efficient.

Functions§

decode_using_format_from
SCALE decode a bit sequence using the given format, handing back an iterator of booleans.
encode_using_format
This is a convenience wrapper around encode_using_format_to.
encode_using_format_to
SCALE encode an iterator of booleans with a known size into a bit sequence using the given format.