pub struct ScopeSelectors {
    pub selectors: Vec<ScopeSelector>,
}Expand description
A selector set that matches anything matched by any of its component selectors.
See The TextMate Docs for how these work.
Fields§
§selectors: Vec<ScopeSelector>The selectors, if any of them match, that this matches
Implementations§
Source§impl ScopeSelectors
 
impl ScopeSelectors
Sourcepub fn does_match(&self, stack: &[Scope]) -> Option<MatchPower>
 
pub fn does_match(&self, stack: &[Scope]) -> Option<MatchPower>
Checks if any of the given selectors match the given scope stack
If so, it returns a match score. Higher match scores indicate stronger matches. Scores are ordered according to the rules found at https://manual.macromates.com/en/scope_selectors.
§Examples
use syntect::parsing::{ScopeStack, MatchPower};
use syntect::highlighting::ScopeSelectors;
use std::str::FromStr;
assert_eq!(ScopeSelectors::from_str("a.b, a e.f - c k, e.f - a.b").unwrap()
    .does_match(ScopeStack::from_str("a.b c.d j e.f").unwrap().as_slice()),
    Some(MatchPower(0o2001u64 as f64)));Trait Implementations§
Source§impl Clone for ScopeSelectors
 
impl Clone for ScopeSelectors
Source§fn clone(&self) -> ScopeSelectors
 
fn clone(&self) -> ScopeSelectors
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl Debug for ScopeSelectors
 
impl Debug for ScopeSelectors
Source§impl Default for ScopeSelectors
 
impl Default for ScopeSelectors
Source§fn default() -> ScopeSelectors
 
fn default() -> ScopeSelectors
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ScopeSelectors
 
impl<'de> Deserialize<'de> for ScopeSelectors
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromStr for ScopeSelectors
 
impl FromStr for ScopeSelectors
Source§fn from_str(s: &str) -> Result<ScopeSelectors, ParseScopeError>
 
fn from_str(s: &str) -> Result<ScopeSelectors, ParseScopeError>
Parses a series of selectors separated by commas or pipes
Source§type Err = ParseScopeError
 
type Err = ParseScopeError
The associated error which can be returned from parsing.
Source§impl PartialEq for ScopeSelectors
 
impl PartialEq for ScopeSelectors
Source§impl Serialize for ScopeSelectors
 
impl Serialize for ScopeSelectors
impl Eq for ScopeSelectors
impl StructuralPartialEq for ScopeSelectors
Auto Trait Implementations§
impl Freeze for ScopeSelectors
impl RefUnwindSafe for ScopeSelectors
impl Send for ScopeSelectors
impl Sync for ScopeSelectors
impl Unpin for ScopeSelectors
impl UnwindSafe for ScopeSelectors
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§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Compare self to 
key and return true if they are equal.