pub enum MetadataFilter {
Show 16 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),
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
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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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§
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 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>
Wrap the input message
T in a tonic::Request