Expand description
length-delimited
§Installation
[dependencies]
length-delimited = "0.2"§License
length-delimited is under the terms of both the MIT license and the
Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT for details.
Copyright (c) 2025 Al Liu.
Structs§
- Incomplete
Buffer - Returned when the buffer does not contains engouth bytes for decoding.
- Insufficient
Buffer - Returned when the encoded buffer is too small to hold the bytes format of the types.
Enums§
- Decode
Bytes Error - The error that can be returned when decoding bytes.
- Decode
Char Error - Error when decoding a character
- Decode
Utf8 Bytes Error - The error that can be returned when decoding utf8 bytes.
- Decode
Varint Error - Decoding varint error.
- Encode
Error - Encode varint error
Traits§
- Bounds
- A trait bound that bounds
Send,Sync, and'staticin possible combinations - Error
Bounds - A trait bound that bounds
Debug,Display,Error,Send,Sync, and'staticin possible combinations - Length
Delimited Decoder - A type can be encode to a buffer.
- Length
Delimited Encoder - A type can be encode to a buffer.
- Varint
- A trait for types that can be encoded as variable-length integers (varints).
Functions§
- decode_
i16_ varint - Decodes a
u16in LEB128 encoded format from the buffer. - decode_
i32_ varint - Decodes a
u32in LEB128 encoded format from the buffer. - decode_
i64_ varint - Decodes a
u64in LEB128 encoded format from the buffer. - decode_
i128_ varint - Decodes a
u128in LEB128 encoded format from the buffer. - decode_
u16_ varint - Decodes a
i16in LEB128 encoded format from the buffer. - decode_
u32_ varint - Decodes a
i32in LEB128 encoded format from the buffer. - decode_
u64_ varint - Decodes a
i64in LEB128 encoded format from the buffer. - decode_
u128_ varint - Decodes a
i128in LEB128 encoded format from the buffer. - encode_
i16_ varint - Encodes an
i16value into LEB128 variable length format, and writes it to the buffer. - encode_
i32_ varint - Encodes an
i32value into LEB128 variable length format, and writes it to the buffer. - encode_
i64_ varint - Encodes an
i64value into LEB128 variable length format, and writes it to the buffer. - encode_
i128_ varint - Encodes an
i128value into LEB128 variable length format, and writes it to the buffer. - encode_
u16_ varint - Encodes an
u16value into LEB128 variable length format, and writes it to the buffer. - encode_
u32_ varint - Encodes an
u32value into LEB128 variable length format, and writes it to the buffer. - encode_
u64_ varint - Encodes an
u64value into LEB128 variable length format, and writes it to the buffer. - encode_
u128_ varint - Encodes an
u128value into LEB128 variable length format, and writes it to the buffer. - encoded_
i16_ varint_ len - Returns the encoded length of the value in LEB128 variable length format.
The returned value will be in range of
i16::ENCODED_LEN_RANGE. - encoded_
i32_ varint_ len - Returns the encoded length of the value in LEB128 variable length format.
The returned value will be in range of
i32::ENCODED_LEN_RANGE. - encoded_
i64_ varint_ len - Returns the encoded length of the value in LEB128 variable length format.
The returned value will be in range
i64::ENCODED_LEN_RANGE. - encoded_
i128_ varint_ len - Returns the encoded length of the value in LEB128 variable length format.
The returned value will be in range
i128::ENCODED_LEN_RANGE. - encoded_
u16_ varint_ len - Returns the encoded length of the value in LEB128 variable length format.
The returned value will be in range of
u16::ENCODED_LEN_RANGE. - encoded_
u32_ varint_ len - Returns the encoded length of the value in LEB128 variable length format.
The returned value will be in range of
u32::ENCODED_LEN_RANGE. - encoded_
u64_ varint_ len - Returns the encoded length of the value in LEB128 variable length format.
The returned value will be in range
u64::ENCODED_LEN_RANGE. - encoded_
u128_ varint_ len - Returns the encoded length of the value in LEB128 variable length format.
The returned value will be in range
u128::ENCODED_LEN_RANGE.