pub struct QueryByExample { /* private fields */ }Expand description
A validated conjunction of clauses.
Every clause is checked as it is added, so a built query can never carry a vacuous clause and evaluation has nothing left to validate.
Implementations§
Source§impl QueryByExample
impl QueryByExample
Sourcepub fn push(&mut self, clause: PredicateClause) -> Result<(), PredicateError>
pub fn push(&mut self, clause: PredicateClause) -> Result<(), PredicateError>
Add one clause.
§Errors
Returns PredicateError if the clause would silently match every
entry: a zero attribute mask, or an empty name set.
Sourcepub fn with(self, clause: PredicateClause) -> Result<Self, PredicateError>
pub fn with(self, clause: PredicateClause) -> Result<Self, PredicateError>
Sourcepub fn clauses(&self) -> &[PredicateClause]
pub fn clauses(&self) -> &[PredicateClause]
The clauses, in the order they were added.
Sourcepub fn matches(&self, entry: &DirectoryEntry) -> bool
pub fn matches(&self, entry: &DirectoryEntry) -> bool
Whether entry satisfies every clause.
Short-circuits on the first clause that fails, so an early cheap clause spares the later expensive ones.
Trait Implementations§
Source§impl Clone for QueryByExample
impl Clone for QueryByExample
Source§fn clone(&self) -> QueryByExample
fn clone(&self) -> QueryByExample
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 QueryByExample
impl Debug for QueryByExample
Source§impl Default for QueryByExample
impl Default for QueryByExample
Source§fn default() -> QueryByExample
fn default() -> QueryByExample
Returns the “default value” for a type. Read more
impl Eq for QueryByExample
Source§impl From<QueryByExample> for EntryPredicate
impl From<QueryByExample> for EntryPredicate
Source§fn from(query: QueryByExample) -> Self
fn from(query: QueryByExample) -> Self
Converts to this type from the input type.
Source§impl PartialEq for QueryByExample
impl PartialEq for QueryByExample
impl StructuralPartialEq for QueryByExample
Auto Trait Implementations§
impl Freeze for QueryByExample
impl RefUnwindSafe for QueryByExample
impl Send for QueryByExample
impl Sync for QueryByExample
impl Unpin for QueryByExample
impl UnsafeUnpin for QueryByExample
impl UnwindSafe for QueryByExample
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