lance_encoding::compression_algo::fastlanes

Trait BitPacking

source
pub trait BitPacking: FastLanes {
    // Required methods
    unsafe fn unchecked_pack(width: usize, input: &[Self], output: &mut [Self]);
    unsafe fn unchecked_unpack(
        width: usize,
        input: &[Self],
        output: &mut [Self],
    );
}
Expand description

BitPack into a compile-time known bit-width.

Required Methods§

source

unsafe fn unchecked_pack(width: usize, input: &[Self], output: &mut [Self])

Packs 1024 elements into W bits each, where W is runtime-known instead of compile-time known.

§Safety

The input slice must be of exactly length 1024. The output slice must be of length 1024 * W / T, where T is the bit-width of Self and W is the packed width. These lengths are checked only with debug_assert (i.e., not checked on release builds).

source

unsafe fn unchecked_unpack(width: usize, input: &[Self], output: &mut [Self])

Unpacks 1024 elements from W bits each, where W is runtime-known instead of compile-time known.

§Safety

The input slice must be of length 1024 * W / T, where T is the bit-width of Self and W is the packed width. The output slice must be of exactly length 1024. These lengths are checked only with debug_assert (i.e., not checked on release builds).

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl BitPacking for u8

source§

unsafe fn unchecked_pack(width: usize, input: &[Self], output: &mut [Self])

source§

unsafe fn unchecked_unpack(width: usize, input: &[Self], output: &mut [Self])

source§

impl BitPacking for u16

source§

unsafe fn unchecked_pack(width: usize, input: &[Self], output: &mut [Self])

source§

unsafe fn unchecked_unpack(width: usize, input: &[Self], output: &mut [Self])

source§

impl BitPacking for u32

source§

unsafe fn unchecked_pack(width: usize, input: &[Self], output: &mut [Self])

source§

unsafe fn unchecked_unpack(width: usize, input: &[Self], output: &mut [Self])

source§

impl BitPacking for u64

source§

unsafe fn unchecked_pack(width: usize, input: &[Self], output: &mut [Self])

source§

unsafe fn unchecked_unpack(width: usize, input: &[Self], output: &mut [Self])

Implementors§