pub enum SelectorSpec {
    And(Vec<SelectorSpec>),
    Or(Vec<SelectorSpec>),
    Not(Box<SelectorSpec>),
    Path(Vec<SelectorPathItem>),
}Expand description
A selector that can match paths of processing states.
To use a selector, you most likely want to check whether it matches the path of a
ProcessingState.  For this you turn the state into a Path using
ProcessingState::path and call SelectorSpec::matches_path, which will iterate through
the path items in the processing state and check whether the selector matches.
Variants§
And(Vec<SelectorSpec>)
A selector that matches both of two sub-selectors.
Or(Vec<SelectorSpec>)
A selector that matches either of two sub-selectors.
Not(Box<SelectorSpec>)
A selector that matches all paths that do not match the sub-selector.
Path(Vec<SelectorPathItem>)
A direct path to an item.
Implementations§
Source§impl SelectorSpec
 
impl SelectorSpec
Sourcepub fn parse_non_legacy(s: &str) -> Result<SelectorSpec, InvalidSelectorError>
 
pub fn parse_non_legacy(s: &str) -> Result<SelectorSpec, InvalidSelectorError>
Parses a selector from a string without legacy special handling.
Sourcepub fn matches_path(&self, path: &Path<'_>) -> bool
 
pub fn matches_path(&self, path: &Path<'_>) -> bool
Checks if a path matches given selector.
This walks both the selector and the path starting at the end and towards the root to determine if the selector matches the current path.
Trait Implementations§
Source§impl Clone for SelectorSpec
 
impl Clone for SelectorSpec
Source§fn clone(&self) -> SelectorSpec
 
fn clone(&self) -> SelectorSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SelectorSpec
 
impl Debug for SelectorSpec
Source§impl<'de> Deserialize<'de> for SelectorSpec
 
impl<'de> Deserialize<'de> for SelectorSpec
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>,
Source§impl Display for SelectorSpec
 
impl Display for SelectorSpec
Source§impl From<ValueType> for SelectorSpec
 
impl From<ValueType> for SelectorSpec
Source§impl FromStr for SelectorSpec
 
impl FromStr for SelectorSpec
Source§impl Ord for SelectorSpec
 
impl Ord for SelectorSpec
Source§fn cmp(&self, other: &SelectorSpec) -> Ordering
 
fn cmp(&self, other: &SelectorSpec) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
Source§impl PartialEq for SelectorSpec
 
impl PartialEq for SelectorSpec
Source§impl PartialOrd for SelectorSpec
 
impl PartialOrd for SelectorSpec
Source§impl Serialize for SelectorSpec
 
impl Serialize for SelectorSpec
impl Eq for SelectorSpec
impl StructuralPartialEq for SelectorSpec
Auto Trait Implementations§
impl Freeze for SelectorSpec
impl RefUnwindSafe for SelectorSpec
impl Send for SelectorSpec
impl Sync for SelectorSpec
impl Unpin for SelectorSpec
impl UnwindSafe for SelectorSpec
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,
§impl<Q, K> Comparable<K> for Q
 
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
 
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
 
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
    T: ?Sized,
 
impl<T> PolicyExt for Twhere
    T: ?Sized,
§impl<T> ToStringFallible for Twhere
    T: Display,
 
impl<T> ToStringFallible for Twhere
    T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
 
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.