pub struct CboRoaringBitmapCodec;
Expand description
A conditionnal codec that either use the RoaringBitmap or a lighter ByteOrder en/decoding method.
Implementations§
Source§impl CboRoaringBitmapCodec
impl CboRoaringBitmapCodec
pub fn serialized_size(roaring: &RoaringBitmap) -> usize
pub fn serialize_into_vec(roaring: &RoaringBitmap, vec: &mut Vec<u8>)
pub fn serialize_into_writer<W: Write>( roaring: &RoaringBitmap, writer: W, ) -> Result<()>
pub fn deserialize_from(bytes: &[u8]) -> Result<RoaringBitmap>
pub fn intersection_with_serialized( bytes: &[u8], other: &RoaringBitmap, ) -> Result<RoaringBitmap>
Sourcepub fn merge_into<I, A>(slices: I, buffer: &mut Vec<u8>) -> Result<()>
pub fn merge_into<I, A>(slices: I, buffer: &mut Vec<u8>) -> Result<()>
Merge serialized CboRoaringBitmaps in a buffer.
if the merged values length is under the threshold, values are directly serialized in the buffer else a RoaringBitmap is created from the values and is serialized in the buffer.
Trait Implementations§
Source§impl BytesDecode<'_> for CboRoaringBitmapCodec
impl BytesDecode<'_> for CboRoaringBitmapCodec
Source§type DItem = RoaringBitmap
type DItem = RoaringBitmap
The type to decode.
Source§fn bytes_decode(bytes: &[u8]) -> Result<Self::DItem, BoxedError>
fn bytes_decode(bytes: &[u8]) -> Result<Self::DItem, BoxedError>
Decode the given bytes as
DItem
.Source§impl BytesDecodeOwned for CboRoaringBitmapCodec
impl BytesDecodeOwned for CboRoaringBitmapCodec
type DItem = RoaringBitmap
fn bytes_decode_owned(bytes: &[u8]) -> Result<Self::DItem, BoxedError>
Source§impl BytesEncode<'_> for CboRoaringBitmapCodec
impl BytesEncode<'_> for CboRoaringBitmapCodec
Source§type EItem = RoaringBitmap
type EItem = RoaringBitmap
The type to encode.
Source§fn bytes_encode(item: &Self::EItem) -> Result<Cow<'_, [u8]>, BoxedError>
fn bytes_encode(item: &Self::EItem) -> Result<Cow<'_, [u8]>, BoxedError>
Encode the given item as bytes.
Auto Trait Implementations§
impl Freeze for CboRoaringBitmapCodec
impl RefUnwindSafe for CboRoaringBitmapCodec
impl Send for CboRoaringBitmapCodec
impl Sync for CboRoaringBitmapCodec
impl Unpin for CboRoaringBitmapCodec
impl UnwindSafe for CboRoaringBitmapCodec
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