pub enum SignedRoaringBitmap {
Include(RoaringBitmap),
Exclude(RoaringBitmap),
}Expand description
This enum helps to delay the evaluation of set minus in metadata filtering:
Include(rbm)suggests the result contains the specified ids inrbm. For example,<k>: {$eq: <v>}will result in aInclude(<record ids with k=v>).Exclude(rbm)suggests the result exludes the specified ids inrbm. For example,<k>: {$ne: <v>}will result in aExclude(<record ids with k=v>)
Without this, we need to figure out the set of existing ids when we evaluate $ne, $nin, and $not_contains,
but this is not always necessary and may lead to overheads. Let’s consider the following where clause as an example:
{$and: [{<k0>: {$gt: <v0>}}, {<k1>: {$ne: <v1>}}]}
The naive way is to evaluate the $gt and $ne seperately and take the conjunction, but this requires
us to know the full set of existing ids because it is needed to evaluate $ne.
However, we can first evaluate $gt and then exclude the offset ids for records with metadata k1=v1.
This behavior is captured in the BitAnd::bitand operator of SignedRoaringBitmap:
- A bitand between
Include(...)andExclude(...)will always result inInclude(...) - This process does not require the knowledge of the full domain
- The domain is needed only when we have to convert an
Exclude(...)to the actual result in the end.
In summary, this enum distinguishes the results that depends on the domain and those that do not:
Include(...)does not depend on the domainExclude(...)depends on the domain We only need to figure out the domain (i.e. the set of ids for existing records) when it is necessary to do so.
Variants§
Include(RoaringBitmap)
Exclude(RoaringBitmap)
Implementations§
Trait Implementations§
Source§impl BitAnd for SignedRoaringBitmap
impl BitAnd for SignedRoaringBitmap
Source§impl BitOr for SignedRoaringBitmap
impl BitOr for SignedRoaringBitmap
Source§impl Clone for SignedRoaringBitmap
impl Clone for SignedRoaringBitmap
Source§fn clone(&self) -> SignedRoaringBitmap
fn clone(&self) -> SignedRoaringBitmap
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SignedRoaringBitmap
impl Debug for SignedRoaringBitmap
Source§impl PartialEq for SignedRoaringBitmap
impl PartialEq for SignedRoaringBitmap
impl StructuralPartialEq for SignedRoaringBitmap
Auto Trait Implementations§
impl Freeze for SignedRoaringBitmap
impl RefUnwindSafe for SignedRoaringBitmap
impl Send for SignedRoaringBitmap
impl Sync for SignedRoaringBitmap
impl Unpin for SignedRoaringBitmap
impl UnwindSafe for SignedRoaringBitmap
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.