[][src]Struct unsegen_pager::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 prototype: Option<Rc<RefCell<Context>>>,
    pub variables: HashMap<String, String, RandomState>,
    pub contexts: HashMap<String, Rc<RefCell<Context>>, RandomState>,
}

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: boolprototype: Option<Rc<RefCell<Context>>>

Filled in at link time to avoid serializing it multiple times

variables: HashMap<String, String, RandomState>contexts: HashMap<String, Rc<RefCell<Context>>, RandomState>

Methods

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 PartialEq<SyntaxDefinition> for SyntaxDefinition[src]

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

impl Clone for SyntaxDefinition[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Eq for SyntaxDefinition[src]

impl Serialize for SyntaxDefinition[src]

impl Debug for SyntaxDefinition[src]

Auto Trait Implementations

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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.

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

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

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

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