pub struct Filter {
pub path: String,
pub op: FilterOp,
pub value: String,
}Expand description
One parsed --filter expression.
Fields§
§path: StringDotted path resolved against each element.
op: FilterOpComparison operator.
value: StringRight-hand literal, compared against the scalar rendering of the field.
Implementations§
Source§impl Filter
impl Filter
Sourcepub fn parse(expr: &str) -> AppResult<Self>
pub fn parse(expr: &str) -> AppResult<Self>
Parse one key=value / key!=value / key==value / key~value expression.
§Errors
Returns crate::error::ErrorKind::InvalidInput (exit 65) when no operator is present or
the key side is empty. A malformed expression is fail-closed on purpose: a
silently empty result set hides a typo far longer than an error does.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Filter
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnsafeUnpin for Filter
impl UnwindSafe for Filter
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