Crate smdiff_common

Source

Structs§

Copy
Copy Operation
Run
Run Operation
SectionHeader
Header struct for a section

Enums§

CopySrc
Where the Copy Operation should copy from.
Format
Format of the how a section is laid out.
Op
Enum for the different types of operations
Size
Used to determine how the size should be handled.

Constants§

ADD
Add bit flag value
COPY_D
Copy from dictionary bit flag value
COPY_O
Copy from output bit flag value
MAX_INST_SIZE
Inclusive Upper Bound
MAX_RUN_LEN
Inclusive Upper Bound
MAX_WIN_SIZE
Inclusive Upper Bound
OP_MASK
Bits for the operation type
RUN
Run bit flag value
SECTION_COMPRESSION_MASK
Section Header Compression Mask
SECTION_COMPRESSION_RSHIFT
Section Header Compression Right Shift amount
SECTION_CONTINUE_BIT
Section Header Continue Bit
SECTION_FORMAT_BIT
Section Header Format Bit
SIZE_MASK
Bits for the Size Value
VERSION_MASK
Section Header Version Mask

Traits§

AddOp
Trait for the Add Operation Depending on the usage, we may want to store the Add bytes in different ways This trait allows for different implementations of the Add Operation within an Op

Functions§

diff_addresses_to_i64
Helper fn to ‘encode’ a copy address from an absolute position (u64) to the relative difference from the last used absolute address.
diff_addresses_to_u64
Helper fn to ‘decode’ a copy address from an i64 to the actual absolute address.
read_i_varint
Read an i64 value from the reader at its current position using i-varint decoding.
read_u8
Read a u8 value from the reader at its current position.
read_u16
Read a u16(little-endian) value from the reader at its current position.
read_u_varint
Read a u64 value from the reader at its current position using u-varint decoding.
size_routine
Used to determine how an operation of size (oal) should be encoded.
u_varint_encode_size
Helper fn to determine how many bytes a given u64 will take when encoded using u-varint.
write_i_varint
Write an i64 value to the writer using i-varint encoding.
write_u8
Write a u8 value to the writer.
write_u16
Write a u16(little-endian) value to the writer.
write_u_varint
Write a u64 value to the writer using u-varint encoding.
zigzag_decode
Convert a u64 to an i64 using ZigZag decoding.
zigzag_encode
Convert an i64 to a u64 using ZigZag encoding.