pub struct Filter {
pub path: String,
pub op: FilterOp,
pub value: String,
}Expand description
A single --filter predicate.
Fields§
§path: StringDotted path into each element.
op: FilterOpComparison to apply.
value: StringRight-hand side, compared as a string.
Implementations§
Source§impl Filter
impl Filter
Sourcepub fn parse(raw: &str) -> Result<Self, String>
pub fn parse(raw: &str) -> Result<Self, String>
Parses key=value, key!=value or key~substring.
§Errors
Returns a human-readable message when no operator is present or the key is empty. Failing loudly matters: a typo that silently matched nothing would look exactly like a legitimately empty result.
Trait Implementations§
impl Eq for Filter
impl StructuralPartialEq for Filter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.