[][src]Struct syntect::parsing::syntax_definition::SyntaxDefinition

pub struct SyntaxDefinition {
    pub name: String,
    pub file_extensions: Vec<String>,
    pub scope: Scope,
    pub first_line_match: Option<String>,
    pub hidden: bool,
    pub variables: HashMap<String, String>,
    pub contexts: HashMap<String, Context>,
}

The main data structure representing a syntax definition loaded from a .sublime-syntax file. You'll probably only need these as references to be passed around to parsing code.

Some useful public fields are the name field which is a human readable name to display in syntax lists, and the hidden field which means hide this syntax from any lists because it is for internal use.

Fields

name: Stringfile_extensions: Vec<String>scope: Scopefirst_line_match: Option<String>hidden: boolvariables: HashMap<String, String>contexts: HashMap<String, Context>

Implementations

impl SyntaxDefinition[src]

pub fn load_from_str(
    s: &str,
    lines_include_newline: bool,
    fallback_name: Option<&str>
) -> Result<SyntaxDefinition, ParseSyntaxError>
[src]

In case you want to create your own SyntaxDefinition's in memory from strings. Generally you should use a SyntaxSet

fallback_name is an optional name to use when the YAML doesn't provide a name key.

Trait Implementations

impl Clone for SyntaxDefinition[src]

impl Debug for SyntaxDefinition[src]

impl<'de> Deserialize<'de> for SyntaxDefinition[src]

impl Eq for SyntaxDefinition[src]

impl PartialEq<SyntaxDefinition> for SyntaxDefinition[src]

impl Serialize for SyntaxDefinition[src]

impl StructuralEq for SyntaxDefinition[src]

impl StructuralPartialEq for SyntaxDefinition[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.