pub enum MetadataFilter {
Show 17 variants
Eq(String, MetadataValue),
Ne(String, MetadataValue),
Gt(String, MetadataValue),
Gte(String, MetadataValue),
Lt(String, MetadataValue),
Lte(String, MetadataValue),
In(String, Vec<MetadataValue>),
NotIn(String, Vec<MetadataValue>),
Contains(String, String),
StartsWith(String, String),
EndsWith(String, String),
GeoRadius {
key: String,
center_lat: f64,
center_lon: f64,
radius_km: f64,
},
Exists(String),
NotExists(String),
And(Vec<MetadataFilter>),
Or(Vec<MetadataFilter>),
Not(Box<MetadataFilter>),
}Expand description
Metadata filter operators
Variants§
Eq(String, MetadataValue)
Equal: key == value
Ne(String, MetadataValue)
Not equal: key != value
Gt(String, MetadataValue)
Greater than: key > value
Gte(String, MetadataValue)
Greater than or equal: key >= value
Lt(String, MetadataValue)
Less than: key < value
Lte(String, MetadataValue)
Less than or equal: key <= value
In(String, Vec<MetadataValue>)
In set: key in [values]
NotIn(String, Vec<MetadataValue>)
Not in set: key not in [values]
Contains(String, String)
String contains: key contains substring
StartsWith(String, String)
String starts with: key starts with prefix
EndsWith(String, String)
String ends with: key ends with suffix
GeoRadius
Geographic radius predicate over a metadata field.
Exists(String)
Key exists
NotExists(String)
Key does not exist
And(Vec<MetadataFilter>)
Logical AND of filters
Or(Vec<MetadataFilter>)
Logical OR of filters
Not(Box<MetadataFilter>)
Logical NOT of filter
Implementations§
Source§impl MetadataFilter
impl MetadataFilter
Sourcepub fn eq(
key: impl Into<String>,
value: impl Into<MetadataValue>,
) -> MetadataFilter
pub fn eq( key: impl Into<String>, value: impl Into<MetadataValue>, ) -> MetadataFilter
Create an equality filter
Sourcepub fn ne(
key: impl Into<String>,
value: impl Into<MetadataValue>,
) -> MetadataFilter
pub fn ne( key: impl Into<String>, value: impl Into<MetadataValue>, ) -> MetadataFilter
Create a not-equal filter
Sourcepub fn gt(
key: impl Into<String>,
value: impl Into<MetadataValue>,
) -> MetadataFilter
pub fn gt( key: impl Into<String>, value: impl Into<MetadataValue>, ) -> MetadataFilter
Create a greater-than filter
Sourcepub fn gte(
key: impl Into<String>,
value: impl Into<MetadataValue>,
) -> MetadataFilter
pub fn gte( key: impl Into<String>, value: impl Into<MetadataValue>, ) -> MetadataFilter
Create a greater-than-or-equal filter
Sourcepub fn lt(
key: impl Into<String>,
value: impl Into<MetadataValue>,
) -> MetadataFilter
pub fn lt( key: impl Into<String>, value: impl Into<MetadataValue>, ) -> MetadataFilter
Create a less-than filter
Sourcepub fn lte(
key: impl Into<String>,
value: impl Into<MetadataValue>,
) -> MetadataFilter
pub fn lte( key: impl Into<String>, value: impl Into<MetadataValue>, ) -> MetadataFilter
Create a less-than-or-equal filter
Sourcepub fn and(filters: Vec<MetadataFilter>) -> MetadataFilter
pub fn and(filters: Vec<MetadataFilter>) -> MetadataFilter
Create an AND filter
Sourcepub fn or(filters: Vec<MetadataFilter>) -> MetadataFilter
pub fn or(filters: Vec<MetadataFilter>) -> MetadataFilter
Create an OR filter
Sourcepub fn not(filter: MetadataFilter) -> MetadataFilter
pub fn not(filter: MetadataFilter) -> MetadataFilter
Create a NOT filter
Sourcepub fn matches(&self, entry: &MetadataEntry) -> bool
pub fn matches(&self, entry: &MetadataEntry) -> bool
Check if a metadata entry matches this 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 moreAuto Trait Implementations§
impl Forget for MetadataFilter
impl Freeze for MetadataFilterwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<MetadataValue>: Freeze,
PhantomData<MetadataFilter>: Freeze,
*const MetadataFilter is !null: Freeze,
impl Move for MetadataFilter
impl RefUnwindSafe for MetadataFilter
impl Send for MetadataFilter
impl Sync for MetadataFilter
impl Unpin for MetadataFilter
impl UnsafeUnpin for MetadataFilterwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<MetadataValue>: UnsafeUnpin,
PhantomData<MetadataFilter>: UnsafeUnpin,
*const MetadataFilter is !null: UnsafeUnpin,
impl UnwindSafe for MetadataFilter
Blanket Implementations§
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
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> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request