Enum kanidmd_lib::filter::FilterResolved
source · pub enum FilterResolved {
Eq(AttrString, PartialValue, Option<NonZeroU8>),
Sub(AttrString, PartialValue, Option<NonZeroU8>),
Pres(AttrString, Option<NonZeroU8>),
LessThan(AttrString, PartialValue, Option<NonZeroU8>),
Or(Vec<FilterResolved>, Option<NonZeroU8>),
And(Vec<FilterResolved>, Option<NonZeroU8>),
Inclusion(Vec<FilterResolved>, Option<NonZeroU8>),
AndNot(Box<FilterResolved>, Option<NonZeroU8>),
}
Expand description
This is the fully resolved internal representation. Note the lack of Not and selfUUID because these are resolved into And(Pres(class), AndNot(term)) and Eq(uuid, …). Importantly, we make this accessible to Entry so that it can then match on filters internally.
Each filter that has been resolved also has been enriched with metadata about its index, and index slope. For the purpose of this module, consider slope as a “weight” where small value - faster index, larger value - slower index. This metadata is extremely important for the query optimiser to make decisions about how to re-arrange queries correctly.
Variants§
Eq(AttrString, PartialValue, Option<NonZeroU8>)
Sub(AttrString, PartialValue, Option<NonZeroU8>)
Pres(AttrString, Option<NonZeroU8>)
LessThan(AttrString, PartialValue, Option<NonZeroU8>)
Or(Vec<FilterResolved>, Option<NonZeroU8>)
And(Vec<FilterResolved>, Option<NonZeroU8>)
Inclusion(Vec<FilterResolved>, Option<NonZeroU8>)
AndNot(Box<FilterResolved>, Option<NonZeroU8>)
Implementations§
Trait Implementations§
source§impl Clone for FilterResolved
impl Clone for FilterResolved
source§fn clone(&self) -> FilterResolved
fn clone(&self) -> FilterResolved
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FilterResolved
impl Debug for FilterResolved
source§impl Ord for FilterResolved
impl Ord for FilterResolved
source§fn cmp(&self, rhs: &FilterResolved) -> Ordering
fn cmp(&self, rhs: &FilterResolved) -> Ordering
Ordering of filters for optimisation and subsequent dead term elimination.
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<FilterResolved> for FilterResolved
impl PartialEq<FilterResolved> for FilterResolved
source§fn eq(&self, rhs: &FilterResolved) -> bool
fn eq(&self, rhs: &FilterResolved) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<FilterResolved> for FilterResolved
impl PartialOrd<FilterResolved> for FilterResolved
source§fn partial_cmp(&self, rhs: &FilterResolved) -> Option<Ordering>
fn partial_cmp(&self, rhs: &FilterResolved) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more