pub struct FilterBuilder { /* private fields */ }Expand description
Builder for constructing filter IR ergonomically
Implementations§
Source§impl FilterBuilder
impl FilterBuilder
Sourcepub fn eq(self, field: &str, value: impl Into<FilterValue>) -> Self
pub fn eq(self, field: &str, value: impl Into<FilterValue>) -> Self
Add an equality constraint
Sourcepub fn ne(self, field: &str, value: impl Into<FilterValue>) -> Self
pub fn ne(self, field: &str, value: impl Into<FilterValue>) -> Self
Add a not-equal constraint
Sourcepub fn in_set(self, field: &str, values: Vec<FilterValue>) -> Self
pub fn in_set(self, field: &str, values: Vec<FilterValue>) -> Self
Add an IN constraint
Sourcepub fn range(
self,
field: &str,
min: Option<impl Into<FilterValue>>,
max: Option<impl Into<FilterValue>>,
) -> Self
pub fn range( self, field: &str, min: Option<impl Into<FilterValue>>, max: Option<impl Into<FilterValue>>, ) -> Self
Add a range constraint
Sourcepub fn gt(self, field: &str, value: impl Into<FilterValue>) -> Self
pub fn gt(self, field: &str, value: impl Into<FilterValue>) -> Self
Add a greater-than constraint
Sourcepub fn gte(self, field: &str, value: impl Into<FilterValue>) -> Self
pub fn gte(self, field: &str, value: impl Into<FilterValue>) -> Self
Add a greater-than-or-equal constraint
Sourcepub fn lt(self, field: &str, value: impl Into<FilterValue>) -> Self
pub fn lt(self, field: &str, value: impl Into<FilterValue>) -> Self
Add a less-than constraint
Sourcepub fn lte(self, field: &str, value: impl Into<FilterValue>) -> Self
pub fn lte(self, field: &str, value: impl Into<FilterValue>) -> Self
Add a less-than-or-equal constraint
Sourcepub fn namespace(self, namespace: &str) -> Self
pub fn namespace(self, namespace: &str) -> Self
Add a namespace constraint (convenience method)
Sourcepub fn time_range(
self,
field: &str,
start: Option<u64>,
end: Option<u64>,
) -> Self
pub fn time_range( self, field: &str, start: Option<u64>, end: Option<u64>, ) -> Self
Add a time range constraint (convenience method)
Sourcepub fn or_atoms(self, atoms: Vec<FilterAtom>) -> Self
pub fn or_atoms(self, atoms: Vec<FilterAtom>) -> Self
Add a disjunction (OR of multiple atoms)
Trait Implementations§
Source§impl Clone for FilterBuilder
impl Clone for FilterBuilder
Source§fn clone(&self) -> FilterBuilder
fn clone(&self) -> FilterBuilder
Returns a duplicate 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 FilterBuilder
impl Debug for FilterBuilder
Source§impl Default for FilterBuilder
impl Default for FilterBuilder
Source§fn default() -> FilterBuilder
fn default() -> FilterBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FilterBuilder
impl RefUnwindSafe for FilterBuilder
impl Send for FilterBuilder
impl Sync for FilterBuilder
impl Unpin for FilterBuilder
impl UnsafeUnpin for FilterBuilder
impl UnwindSafe for FilterBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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