[−][src]Struct syntect::parsing::syntax_definition::SyntaxDefinition
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: String
file_extensions: Vec<String>
scope: Scope
first_line_match: Option<String>
variables: 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]
s: &str,
lines_include_newline: bool,
fallback_name: Option<&str>
) -> Result<SyntaxDefinition, ParseSyntaxError>
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]
fn clone(&self) -> SyntaxDefinition
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SyntaxDefinition
[src]
impl<'de> Deserialize<'de> for SyntaxDefinition
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for SyntaxDefinition
[src]
impl PartialEq<SyntaxDefinition> for SyntaxDefinition
[src]
fn eq(&self, other: &SyntaxDefinition) -> bool
[src]
fn ne(&self, other: &SyntaxDefinition) -> bool
[src]
impl Serialize for SyntaxDefinition
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for SyntaxDefinition
[src]
impl StructuralPartialEq for SyntaxDefinition
[src]
Auto Trait Implementations
impl !RefUnwindSafe for SyntaxDefinition
impl Send for SyntaxDefinition
impl Sync for SyntaxDefinition
impl Unpin for SyntaxDefinition
impl UnwindSafe for SyntaxDefinition
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,