pub enum BytepackedIntegerEncoder {
U8(U8BytePacker),
U16(U16BytePacker),
U32(U32BytePacker),
U64(U64BytePacker),
Zero,
}
Expand description
A bytepacked integer encoder that automatically chooses the smallest possible integer type to store the given values.
This is byte packing (not bit packing). Not even that, we only fit things into sizes of 1,2,4,8 bytes. It’s simple, fast, and easy but doesn’t provide the maximum possible compression.
Still, it’s useful for things like offsets which are often small and fit into a u16 or u32 but sometimes might need the full u64 range.
In the future we can investigate replacing this with something more sophisticated.
Variants§
Implementations§
Source§impl BytepackedIntegerEncoder
impl BytepackedIntegerEncoder
Sourcepub fn with_capacity(capacity: usize, max_value: u64) -> Self
pub fn with_capacity(capacity: usize, max_value: u64) -> Self
Create a new encoder with the given capacity and maximum value.
Auto Trait Implementations§
impl Freeze for BytepackedIntegerEncoder
impl RefUnwindSafe for BytepackedIntegerEncoder
impl Send for BytepackedIntegerEncoder
impl Sync for BytepackedIntegerEncoder
impl Unpin for BytepackedIntegerEncoder
impl UnwindSafe for BytepackedIntegerEncoder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more