pub enum Filter {
Eq {
field: String,
value: Value,
},
In {
field: String,
values: Vec<Value>,
},
Range {
field: String,
gt: Option<f64>,
gte: Option<f64>,
lt: Option<f64>,
lte: Option<f64>,
},
And(Vec<Filter>),
}Expand description
Metadata predicate applied during search.
Fields are addressed by dotted paths ("source.lang"). A record without
the field never matches.
Variants§
Implementations§
Source§impl Filter
impl Filter
pub fn eq(field: impl Into<String>, value: impl Into<Value>) -> Self
pub fn is_in( field: impl Into<String>, values: impl IntoIterator<Item = Value>, ) -> Self
Sourcepub fn between(
field: impl Into<String>,
gte: Option<f64>,
lte: Option<f64>,
) -> Self
pub fn between( field: impl Into<String>, gte: Option<f64>, lte: Option<f64>, ) -> Self
Inclusive range. Either bound may be omitted.
pub fn matches(&self, metadata: Option<&Value>) -> bool
Trait Implementations§
impl StructuralPartialEq for Filter
Auto Trait Implementations§
impl Freeze for Filter
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnsafeUnpin for Filter
impl UnwindSafe for Filter
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