Trait stream_vbyte::Encoder [] [src]

pub trait Encoder {
    fn encode_quads(
        input: &[u32],
        control_bytes: &mut [u8],
        output: &mut [u8]
    ) -> (usize, usize); }

Encode numbers to bytes.

Required Methods

Encode complete quads of input numbers.

control_bytes will be exactly as long as the number of complete 4-number quads in input.

Control bytes are written to control_bytes and encoded numbers to output.

Implementations may choose to encode fewer than the full provided input, but any writes done must be for full quads.

Implementations must not write to output outside of the area that will be populated by encoded numbers when all control bytes are processed..

Returns the number of numbers encoded and the number of bytes written to output.

Implementors