Trait stream_vbyte::decode::Decoder [−][src]
pub trait Decoder {
type DecodedQuad;
fn decode_quads<S: DecodeQuadSink<Self>>(
control_bytes: &[u8],
encoded_nums: &[u8],
max_control_bytes_to_decode: usize,
nums_already_decoded: usize,
sink: &mut S
) -> (usize, usize);
}Expand description
Decode bytes to numbers.
Associated Types
type DecodedQuad
Required methods
Decode encoded numbers in complete quads.
Only control bytes with 4 corresponding encoded numbers will be provided as input (i.e. no trailing partial quad).
control_bytes are the control bytes that correspond to encoded_nums.
max_control_bytes_to_decode may be greater than the number of control bytes remaining, in
which case only the remaining control bytes will be decoded.
Implementations may decode at most max_control_bytes_to_decode control bytes, but may
decode fewer.
nums_already_decoded is the number of numbers that have already been decoded in the
DecodeCursor.decode invocation.
Returns a tuple of the number of numbers decoded (always a multiple of 4; at most
4 * max_control_bytes_to_decode) and the number of bytes read from encoded_nums.