pub struct Filter<STATE> { /* private fields */ }Expand description
A Filter is a logical set of assertions about the state of an Entry and
it’s avas. Filters are built from a set of possible assertions.
Presence. An ava of that attribute’s name exists, with any value on theEntry.Equality. An ava of the attribute exists and contains this matching value.Substring. An ava of the attribute exists and has a substring containing the requested value.Or. Contains multiple filters and asserts at least one is true.And. Contains multiple filters and asserts all of them are true.AndNot. This is different to a “logical not” operation. This asserts that a condition is not true in the current candidate set. A search ofAndNotalone will yield not results, but anAndNotin anAndquery will assert that a condition can not hold.
Filters for security reasons are validated by the schema to assert all requested attributes
are valid and exist in the schema so that they can have their indexes correctly used. This avoids
a denial of service attack that may lead to full-table scans.
This Filter validation state is in the STATE attribute and will be either FilterInvalid
or FilterValid. The Filter must be checked by the schema to move to FilterValid. This
helps to prevent errors at compile time to assert Filters are securely checked
Implementations§
Source§impl Filter<FilterValidResolved>
impl Filter<FilterValidResolved>
pub fn to_inner(&self) -> &FilterResolved
Source§impl Filter<FilterValid>
impl Filter<FilterValid>
pub fn invalidate(self) -> Filter<FilterInvalid>
pub fn resolve( &self, ev: &Identity, idxmeta: Option<&IdxMeta>, rsv_cache: Option<&mut ResolveFilterCacheReadTxn<'_>>, ) -> Result<Filter<FilterValidResolved>, OperationError>
pub fn get_attr_set(&self) -> BTreeSet<Attribute>
pub fn into_recycled(self) -> Self
Source§impl Filter<FilterInvalid>
impl Filter<FilterInvalid>
pub fn new(inner: FC) -> Self
pub fn new_recycled(inner: FC) -> Self
pub fn join_parts_and(a: Self, b: Self) -> Self
pub fn validate( &self, schema: &dyn SchemaTransaction, ) -> Result<Filter<FilterValid>, SchemaError>
pub fn from_ro( ev: &Identity, f: &ProtoFilter, qs: &mut QueryServerReadTransaction<'_>, ) -> Result<Self, OperationError>
pub fn from_rw( ev: &Identity, f: &ProtoFilter, qs: &mut QueryServerWriteTransaction<'_>, ) -> Result<Self, OperationError>
pub fn from_ldap_ro( ev: &Identity, f: &LdapFilter, qs: &mut QueryServerReadTransaction<'_>, ) -> Result<Self, OperationError>
pub fn from_scim_ro( ev: &Identity, f: &ScimFilter, qs: &mut QueryServerReadTransaction<'_>, ) -> Result<Self, OperationError>
Trait Implementations§
Source§impl Debug for Filter<FilterInvalid>
impl Debug for Filter<FilterInvalid>
Source§impl Debug for Filter<FilterValid>
impl Debug for Filter<FilterValid>
Source§impl Debug for Filter<FilterValidResolved>
impl Debug for Filter<FilterValidResolved>
Source§impl FromStr for Filter<FilterInvalid>
impl FromStr for Filter<FilterInvalid>
Source§impl<STATE: Ord> Ord for Filter<STATE>
impl<STATE: Ord> Ord for Filter<STATE>
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<STATE: PartialOrd> PartialOrd for Filter<STATE>
impl<STATE: PartialOrd> PartialOrd for Filter<STATE>
impl<STATE: Eq> Eq for Filter<STATE>
impl<STATE> StructuralPartialEq for Filter<STATE>
Auto Trait Implementations§
impl<STATE> Freeze for Filter<STATE>where
STATE: Freeze,
impl<STATE> RefUnwindSafe for Filter<STATE>where
STATE: RefUnwindSafe,
impl<STATE> Send for Filter<STATE>where
STATE: Send,
impl<STATE> Sync for Filter<STATE>where
STATE: Sync,
impl<STATE> Unpin for Filter<STATE>where
STATE: Unpin,
impl<STATE> UnwindSafe for Filter<STATE>where
STATE: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].