columnar::bytes

Trait EncodeDecode

Source
pub trait EncodeDecode {
    // Required methods
    fn length_in_words<'a, A>(bytes: &A) -> usize
       where A: AsBytes<'a>;
    fn encode<'a, A>(store: &mut Vec<u64>, bytes: &A)
       where A: AsBytes<'a>;
    fn write<'a, A, W: Write>(writer: W, bytes: &A) -> Result<()>
       where A: AsBytes<'a>;
    fn decode<'a>(store: &'a [u64]) -> impl Iterator<Item = &'a [u8]>;

    // Provided method
    fn length_in_bytes<'a, A>(bytes: &A) -> usize
       where A: AsBytes<'a> { ... }
}
Expand description

A coupled encode/decode pair for byte sequences.

Required Methods§

Source

fn length_in_words<'a, A>(bytes: &A) -> usize
where A: AsBytes<'a>,

Encoded length in number of u64 words required.

Source

fn encode<'a, A>(store: &mut Vec<u64>, bytes: &A)
where A: AsBytes<'a>,

Encodes bytes into a sequence of u64.

Source

fn write<'a, A, W: Write>(writer: W, bytes: &A) -> Result<()>
where A: AsBytes<'a>,

Writes bytes in the encoded format to an arbitrary writer.

Source

fn decode<'a>(store: &'a [u64]) -> impl Iterator<Item = &'a [u8]>

Decodes bytes from a sequence of u64.

Provided Methods§

Source

fn length_in_bytes<'a, A>(bytes: &A) -> usize
where A: AsBytes<'a>,

Encoded length in number of u8 bytes required.

This method should always be eight times Self::length_in_words, and is provided for convenience and clarity.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§