Enum qualia::query_builder::QueryBuilder
source · pub enum QueryBuilder {
// some variants omitted
}
Expand description
A convenience class for creating QueryNode
objects. This enum should be used by calling
methods on Q
, rather than by creating a new QueryBuilder
yourself.
A QueryBuilder
starts out empty. Each call to .id()
, .equal()
, or .like()
will add a new criteria to the query. All these criteria are then ANDed together.
Implementations§
source§impl QueryBuilder
impl QueryBuilder
sourcepub fn id(self, value: impl Into<i64>) -> Self
pub fn id(self, value: impl Into<i64>) -> Self
Add the criteria that the object have the given ID.
sourcepub fn equal(self, name: impl Into<String>, value: impl Into<PropValue>) -> Self
pub fn equal(self, name: impl Into<String>, value: impl Into<PropValue>) -> Self
Add the criteria that the given field has exactly the given value.
sourcepub fn like(self, name: impl Into<String>, pattern: impl Into<String>) -> Self
pub fn like(self, name: impl Into<String>, pattern: impl Into<String>) -> Self
Add the criteria that the given field have contents matching the given value.
See PropLike
for the supported syntax.
sourcepub fn build(self) -> QueryNode
pub fn build(self) -> QueryNode
Consume this QueryBuilder
and build a QueryNode
.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for QueryBuilder
impl Send for QueryBuilder
impl Sync for QueryBuilder
impl Unpin for QueryBuilder
impl UnwindSafe for QueryBuilder
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