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

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>,
}
Expand description

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.