Struct syntect::highlighting::ScopeSelector
source · pub struct ScopeSelector {
pub path: ScopeStack,
pub excludes: Vec<ScopeStack>,
}
Expand description
A single selector consisting of a stack to match and a possible stack to exclude from being matched.
You probably want ScopeSelectors
which is this but with union support.
Fields§
§path: ScopeStack
§excludes: Vec<ScopeStack>
Implementations§
source§impl ScopeSelector
impl ScopeSelector
sourcepub fn does_match(&self, stack: &[Scope]) -> Option<MatchPower>
pub fn does_match(&self, stack: &[Scope]) -> Option<MatchPower>
Checks if this selector matches a given scope stack.
See ScopeSelectors::does_match
for more info.
sourcepub fn extract_single_scope(&self) -> Option<Scope>
pub fn extract_single_scope(&self) -> Option<Scope>
If this selector is really just a single scope, return it
sourcepub fn extract_scopes(&self) -> Vec<Scope> ⓘ
pub fn extract_scopes(&self) -> Vec<Scope> ⓘ
Extract all selectors for generating CSS
Trait Implementations§
source§impl Clone for ScopeSelector
impl Clone for ScopeSelector
source§fn clone(&self) -> ScopeSelector
fn clone(&self) -> ScopeSelector
Returns a copy 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 ScopeSelector
impl Debug for ScopeSelector
source§impl Default for ScopeSelector
impl Default for ScopeSelector
source§fn default() -> ScopeSelector
fn default() -> ScopeSelector
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for ScopeSelector
impl<'de> Deserialize<'de> for ScopeSelector
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 ScopeSelector
impl FromStr for ScopeSelector
source§fn from_str(s: &str) -> Result<ScopeSelector, ParseScopeError>
fn from_str(s: &str) -> Result<ScopeSelector, ParseScopeError>
Parses a scope stack followed optionally by (one or more) “ -“ and then a scope stack to exclude
§type Err = ParseScopeError
type Err = ParseScopeError
The associated error which can be returned from parsing.
source§impl PartialEq<ScopeSelector> for ScopeSelector
impl PartialEq<ScopeSelector> for ScopeSelector
source§fn eq(&self, other: &ScopeSelector) -> bool
fn eq(&self, other: &ScopeSelector) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ScopeSelector
impl Serialize for ScopeSelector
impl Eq for ScopeSelector
impl StructuralEq for ScopeSelector
impl StructuralPartialEq for ScopeSelector
Auto Trait Implementations§
impl RefUnwindSafe for ScopeSelector
impl Send for ScopeSelector
impl Sync for ScopeSelector
impl Unpin for ScopeSelector
impl UnwindSafe for ScopeSelector
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.