pub enum FilterAtom {
Eq {
field: String,
value: FilterValue,
},
Ne {
field: String,
value: FilterValue,
},
In {
field: String,
values: Vec<FilterValue>,
},
NotIn {
field: String,
values: Vec<FilterValue>,
},
Range {
field: String,
min: Option<FilterValue>,
max: Option<FilterValue>,
min_inclusive: bool,
max_inclusive: bool,
},
Prefix {
field: String,
prefix: String,
},
Contains {
field: String,
substring: String,
},
HasTag {
tag: String,
},
True,
False,
}Expand description
A single filter atom - the smallest unit of filtering
Variants§
Eq
Equality: field = value
Ne
Not equal: field != value
In
Membership: field IN (v1, v2, …)
NotIn
Not in set: field NOT IN (v1, v2, …)
Range
Range: min <= field <= max (inclusive) Either bound can be None for open-ended ranges
Prefix
Prefix match: field STARTS WITH prefix
Contains
Contains substring: field CONTAINS substring
HasTag
ACL tag presence (for row-level security)
True
Always true (identity for conjunction)
False
Always false (identity for disjunction)
Implementations§
Source§impl FilterAtom
impl FilterAtom
Sourcepub fn eq(field: impl Into<String>, value: impl Into<FilterValue>) -> Self
pub fn eq(field: impl Into<String>, value: impl Into<FilterValue>) -> Self
Create an equality atom
Sourcepub fn range(
field: impl Into<String>,
min: Option<FilterValue>,
max: Option<FilterValue>,
) -> Self
pub fn range( field: impl Into<String>, min: Option<FilterValue>, max: Option<FilterValue>, ) -> Self
Create a range atom
Sourcepub fn range_exclusive(
field: impl Into<String>,
min: Option<FilterValue>,
max: Option<FilterValue>,
) -> Self
pub fn range_exclusive( field: impl Into<String>, min: Option<FilterValue>, max: Option<FilterValue>, ) -> Self
Create an open range (exclusive bounds)
Sourcepub fn is_trivially_true(&self) -> bool
pub fn is_trivially_true(&self) -> bool
Check if this atom is always true
Sourcepub fn is_trivially_false(&self) -> bool
pub fn is_trivially_false(&self) -> bool
Check if this atom is always false
Sourcepub fn negate(&self) -> FilterAtom
pub fn negate(&self) -> FilterAtom
Negate this atom
Trait Implementations§
Source§impl Clone for FilterAtom
impl Clone for FilterAtom
Source§fn clone(&self) -> FilterAtom
fn clone(&self) -> FilterAtom
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 FilterAtom
impl Debug for FilterAtom
Source§impl<'de> Deserialize<'de> for FilterAtom
impl<'de> Deserialize<'de> for FilterAtom
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for FilterAtom
impl Display for FilterAtom
Source§impl PartialEq for FilterAtom
impl PartialEq for FilterAtom
Source§impl Serialize for FilterAtom
impl Serialize for FilterAtom
impl StructuralPartialEq for FilterAtom
Auto Trait Implementations§
impl Freeze for FilterAtom
impl RefUnwindSafe for FilterAtom
impl Send for FilterAtom
impl Sync for FilterAtom
impl Unpin for FilterAtom
impl UnsafeUnpin for FilterAtom
impl UnwindSafe for FilterAtom
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more