pub enum AttrExp {
Present(AttrPath),
Comparison(AttrPath, CompareOp, CompValue),
}Expand description
An atomic filter expression: a presence test or an attribute comparison.
// "title pr" — attribute is present and non-null
let present = AttrExp::Present(AttrPath::with_name("title"));
assert_eq!(Filter::Attr(present).to_string(), "title pr");
// "userName eq \"bjensen\""
let cmp = AttrExp::Comparison(
AttrPath::with_name("userName"),
CompareOp::Eq,
"bjensen".into(),
);
assert_eq!(Filter::Attr(cmp).to_string(), r#"userName eq "bjensen""#);Variants§
Present(AttrPath)
The pr (present) operator. Matches when the attribute exists and is not null.
Example: title pr
Comparison(AttrPath, CompareOp, CompValue)
A comparison operator with a value.
Example: userName eq "bjensen", meta.lastModified gt "2024-01-01T00:00:00Z"
Trait Implementations§
impl StructuralPartialEq for AttrExp
Auto Trait Implementations§
impl Freeze for AttrExp
impl RefUnwindSafe for AttrExp
impl Send for AttrExp
impl Sync for AttrExp
impl Unpin for AttrExp
impl UnsafeUnpin for AttrExp
impl UnwindSafe for AttrExp
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