Module encoder

Source

Enums§

EncodeError
EncodeError wraps the value that caused an error during encoding and returns it. Example Err(EncoderErr::Int16(2422)) is used to depict that value 2422 which was of type int16 caused an error during encoding.
EncodeOrder
EncodeOrder is used to specify the endian order signed and unsigned integers while encoding. Example: EncodeOrder::Big is used to specify that all the integers should be ordered according to Big-Endian byte ordering.
EncodeType
EncodeType contains various data-types that are supported by packed-encoder. This enum can be used to tell the encoder how a specific data needs to be encoded. Example: EncodeType::Int16(2422) tells the encoder to encode the value 2422 as a 16-bit signed integer.

Functions§

encode_packed
encode_packed encodes an array of values of any EncodeType enum into a packed byte-array. Returns the byte vector representing the packed byte-array or EncodeErr enum.