Expand description
Minimal SCALE codec for the Polkadot app host-api wire format.
Implements only the primitives used by the protocol: compact integers, strings, bytes, enums (u8 tag), options, results, vectors.
Structs§
Enums§
Functions§
- encode_
compact_ u32 - SCALE compact integer encode (u32 range).
- encode_
option_ none - Option::None = [0x00].
- encode_
option_ some - Option::Some prefix = [0x01], then caller writes the value.
- encode_
result_ err - Result::Err with inner error.
- encode_
result_ ok - Result::Ok with inner value.
- encode_
result_ ok_ void - Result::Ok(void) = [0x00].
- encode_
string - SCALE string: compact length + UTF-8 bytes.
- encode_
tag - Enum tag (u8).
- encode_
var_ bytes - Dynamic-length bytes: compact length + raw bytes.
- encode_
vector_ len - Vector: compact count + items (caller encodes each item).