pub struct FilterExpr { /* private fields */ }Expand description
One parsed --filter predicate.
Implementations§
Source§impl FilterExpr
impl FilterExpr
Sourcepub fn parse(raw: &str) -> Result<Self, String>
pub fn parse(raw: &str) -> Result<Self, String>
Parses one --filter expression.
§Errors
Returns a localized message when no operator is present or when the key side is empty.
Sourcepub fn key(&self) -> String
pub fn key(&self) -> String
The dotted path this predicate addresses, as the caller wrote it.
The gate needs the key to resolve it against the envelope vocabulary and
to name it in a refusal; rebuilding the string from Self::path at
every call site would duplicate the join.
Sourcepub fn path(&self) -> &[String]
pub fn path(&self) -> &[String]
The parsed path segments, for callers that resolve rather than compare.
Sourcepub fn matches(&self, element: &Value, command: Option<&str>) -> bool
pub fn matches(&self, element: &Value, command: Option<&str>) -> bool
Evaluates the predicate against one element.
A missing or non-scalar path never satisfies FilterOp::Equals or
FilterOp::Contains; it does satisfy FilterOp::NotEquals,
which reads as “this element does not carry that value”.
GAP-SG-274: command is the surface’s subcommand slug, and it scopes the
synonym table exactly as it scopes the gate. Passing None here would not
merely narrow the lookup — it would let the gate ACCEPT a key the walk
then fails to find, which is the accepted-and-ignored shape the surface
exists to remove.
Trait Implementations§
Source§impl Clone for FilterExpr
impl Clone for FilterExpr
Source§fn clone(&self) -> FilterExpr
fn clone(&self) -> FilterExpr
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FilterExpr
impl Debug for FilterExpr
impl Eq for FilterExpr
Source§impl PartialEq for FilterExpr
impl PartialEq for FilterExpr
impl StructuralPartialEq for FilterExpr
Auto Trait Implementations§
impl Freeze for FilterExpr
impl RefUnwindSafe for FilterExpr
impl Send for FilterExpr
impl Sync for FilterExpr
impl Unpin for FilterExpr
impl UnsafeUnpin for FilterExpr
impl UnwindSafe for FilterExpr
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
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
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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 more