Module scale_bits::scale
source · Expand description
This module exposes some utilities for working with SCALE bit sequences, namely:
- Encoding: see
encode_using_formatandencode_using_format_to. - Decoding: see
decode_using_format_from. - Talking about obtaining the format of said bit sequences: see the
formatmodule.
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
Ths module defines a
Format, which is basically a StoreFormat and an
OrderFormat and describes the different possible wire formats of a bit sequence.Structs
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
SCALE decode a bit sequence using the given format, handing back an iterator of booleans.
This is a convenience wrapper around
encode_using_format_to.SCALE encode an iterator of booleans with a known size into a bit sequence using the
given format.