pub enum MetadataFilter {
Show 17 variants
Equals(String, MetadataValue),
NotEquals(String, MetadataValue),
GreaterThan(String, MetadataValue),
GreaterThanOrEqual(String, MetadataValue),
LessThan(String, MetadataValue),
LessThanOrEqual(String, MetadataValue),
Contains(String, String),
StartsWith(String, String),
EndsWith(String, String),
In(String, Vec<MetadataValue>),
NotIn(String, Vec<MetadataValue>),
Exists(String),
NotExists(String),
TimeRange {
field: String,
start: Option<u64>,
end: Option<u64>,
},
And(Vec<MetadataFilter>),
Or(Vec<MetadataFilter>),
Not(Box<MetadataFilter>),
}Expand description
Metadata filter expression
Variants§
Equals(String, MetadataValue)
Equality check: field == value
NotEquals(String, MetadataValue)
Not equal: field != value
GreaterThan(String, MetadataValue)
Greater than: field > value
GreaterThanOrEqual(String, MetadataValue)
Greater than or equal: field >= value
LessThan(String, MetadataValue)
Less than: field < value
LessThanOrEqual(String, MetadataValue)
Less than or equal: field <= value
Contains(String, String)
String contains: field contains substring
StartsWith(String, String)
String starts with: field starts with prefix
EndsWith(String, String)
String ends with: field ends with suffix
In(String, Vec<MetadataValue>)
Value in set: field in [values]
NotIn(String, Vec<MetadataValue>)
Value not in set: field not in [values]
Exists(String)
Field exists
NotExists(String)
Field does not exist
TimeRange
Timestamp range: created_at or updated_at within range
And(Vec<MetadataFilter>)
Logical AND of multiple filters
Or(Vec<MetadataFilter>)
Logical OR of multiple filters
Not(Box<MetadataFilter>)
Logical NOT
Implementations§
Source§impl MetadataFilter
impl MetadataFilter
Sourcepub fn eq(field: impl Into<String>, value: MetadataValue) -> Self
pub fn eq(field: impl Into<String>, value: MetadataValue) -> Self
Create an equals filter
Sourcepub fn ne(field: impl Into<String>, value: MetadataValue) -> Self
pub fn ne(field: impl Into<String>, value: MetadataValue) -> Self
Create a not equals filter
Sourcepub fn gt(field: impl Into<String>, value: MetadataValue) -> Self
pub fn gt(field: impl Into<String>, value: MetadataValue) -> Self
Create a greater than filter
Sourcepub fn gte(field: impl Into<String>, value: MetadataValue) -> Self
pub fn gte(field: impl Into<String>, value: MetadataValue) -> Self
Create a greater than or equal filter
Sourcepub fn lt(field: impl Into<String>, value: MetadataValue) -> Self
pub fn lt(field: impl Into<String>, value: MetadataValue) -> Self
Create a less than filter
Sourcepub fn lte(field: impl Into<String>, value: MetadataValue) -> Self
pub fn lte(field: impl Into<String>, value: MetadataValue) -> Self
Create a less than or equal filter
Sourcepub fn time_range(
field: impl Into<String>,
start: Option<u64>,
end: Option<u64>,
) -> Self
pub fn time_range( field: impl Into<String>, start: Option<u64>, end: Option<u64>, ) -> Self
Create a time range filter
Sourcepub fn and(filters: Vec<MetadataFilter>) -> Self
pub fn and(filters: Vec<MetadataFilter>) -> Self
Create an AND filter
Sourcepub fn or(filters: Vec<MetadataFilter>) -> Self
pub fn or(filters: Vec<MetadataFilter>) -> Self
Create an OR filter
Sourcepub fn negate(filter: MetadataFilter) -> Self
pub fn negate(filter: MetadataFilter) -> Self
Create a NOT filter
Trait Implementations§
Source§impl Clone for MetadataFilter
impl Clone for MetadataFilter
Source§fn clone(&self) -> MetadataFilter
fn clone(&self) -> MetadataFilter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MetadataFilter
impl Debug for MetadataFilter
Source§impl<'de> Deserialize<'de> for MetadataFilter
impl<'de> Deserialize<'de> for MetadataFilter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MetadataFilter
impl RefUnwindSafe for MetadataFilter
impl Send for MetadataFilter
impl Sync for MetadataFilter
impl Unpin for MetadataFilter
impl UnsafeUnpin for MetadataFilter
impl UnwindSafe for MetadataFilter
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.