pub struct ZigzagEncoding;Expand description
Zigzag encoding for efficient signed integer compression
Maps signed integers to unsigned with smaller magnitude: 0 → 0, -1 → 1, 1 → 2, -2 → 3, 2 → 4, …
Implementations§
Source§impl ZigzagEncoding
impl ZigzagEncoding
Sourcepub fn encode_sequence(values: &[i64]) -> Vec<u64>
pub fn encode_sequence(values: &[i64]) -> Vec<u64>
Encode sequence of signed integers
Sourcepub fn decode_sequence(values: &[u64]) -> Vec<i64>
pub fn decode_sequence(values: &[u64]) -> Vec<i64>
Decode sequence of unsigned integers
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ZigzagEncoding
impl RefUnwindSafe for ZigzagEncoding
impl Send for ZigzagEncoding
impl Sync for ZigzagEncoding
impl Unpin for ZigzagEncoding
impl UnsafeUnpin for ZigzagEncoding
impl UnwindSafe for ZigzagEncoding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more