Expand description
A Codec is a trait that provides encode and decode to convert to/from different byte
encoding formats
Structs§
- Code
Dictionary std - Simple auto-incrementing dictionary indexed by hash value. Creates new codes for new values when first seen. Increments in order of query.
- Group
Varint Code Decoder std - Group
Varint Code Encoder std - Converts values into codes using
CodeDictionary, then usesGroupVarintCodeEncoderto encode a sequence of 4 codes to the stream. If a code hasn’t been written before, we immediately follow the group varint block with the specific coded value(s) (up to 4). - Shared
Code Dictionary std - Wraps
CodeDictionaryin anArc<RwLock>>for shared access. - Shared
Group Varint Code Encoder std - Converts values into codes using
CodeDictionary, then usesGroupVarintCodeEncoderto encode a sequence of 4 codes to the stream. If a code hasn’t been written before, we immediately follow the group varint block with the specific coded value(s) (up to 4).
Traits§
- Codec
- Something that can encode or decode bytes to bytes
- Decode
Group Varint From - Decode
Used Bytes From - DecodeV
Byte - Decode
Varint - Decodes up to 9 bytes in the sqlite4 varint format
- Encode
Group Varint To - The ‘Group Varint’ format, which moves all the control bits to header bytes
- Encode
Used Bytes To - Writes only the used number of bytes in the integer to the output stream.
- EncodeV
Byte alloc - EncodeV
Byte Length - EncodeV
Byte To - Encode
Varint To - Encodes up to 9 bytes in the sqlite4 varint format.
- Group
Varint Required Length - The required length to encode in the group varint format. Either 1, 2, 3, or 4 bytes.
- ZagZig
- ZigZag
Functions§
- decode_
varint - Decodes up to 9 bytes in the sqlite4 varint format
- decode_
vbyte - encode_
7bits - encode_
8bits - encode_
14bits - 14 bits =
0x3FFF - encode_
16bits - 16 bits =>
0xFFFF - encode_
21bits - 21 bits =>
0x1F_FFFF - encode_
28bits - 28 bits =>
0xFFF_FFFF - encode_
32bits - 32 bits =>
0xFFFF_FFFF - encode_
35bits - 35 bits =>
0x7_FFFF_FFFF - encode_
42bits - 42 bits =>
0x3FF_FFFF_FFFF - encode_
49bits - 49 bits =>
0x1_FFFF_FFFF_FFFF - encode_
56bits - 56 bits =>
0xFF_FFFF_FFFF_FFFF - encode_
63bits - 63 bits =>
0x7FFF_FFFF_FFFF_FFFF - encode_
64bits - 64 bits => 0xFFFF_FFFF_FFFF_FFFF
- encode_
integer alloc - encode_
integer_ to - encode_
le_ integer_ to - encode_
u128bits - 70 bits => 0x3F_FFFF_FFFF_FFFF_FFFF
- encode_
varint_ to - Encodes up to 9 bytes in the sqlite4 varint format. Returns the number of bytes actually written.
- encode_
vbyte_ to - gvarint_
length - The required length to encode in the group varint format. Either 1, 2, 3, or 4 bytes.
- resultant_
length - zagzig_
u8 - zagzig_
u16 - zagzig_
u32 - zagzig_
u64 - zagzig_
u128 - zigzag_
i8 - zigzag_
i16 - zigzag_
i32 - zigzag_
i64 - zigzag_
i128