pub struct Syntax {
pub language: &'static str,
pub case_sensitive: bool,
pub comment: &'static str,
pub comment_multiline: [&'static str; 2],
pub hyperlinks: BTreeSet<&'static str>,
pub keywords: BTreeSet<&'static str>,
pub types: BTreeSet<&'static str>,
pub special: BTreeSet<&'static str>,
}Expand description
Rules for highlighting.
Fields§
§language: &'static str§case_sensitive: bool§comment: &'static str§comment_multiline: [&'static str; 2]§hyperlinks: BTreeSet<&'static str>§keywords: BTreeSet<&'static str>§types: BTreeSet<&'static str>§special: BTreeSet<&'static str>Implementations§
Source§impl Syntax
impl Syntax
pub fn new(language: &'static str) -> Self
pub fn with_case_sensitive(self, case_sensitive: bool) -> Self
pub fn with_comment(self, comment: &'static str) -> Self
pub fn with_comment_multiline( self, comment_multiline: [&'static str; 2], ) -> Self
pub fn with_hyperlinks<T: Into<BTreeSet<&'static str>>>( self, hyperlinks: T, ) -> Self
pub fn with_keywords<T: Into<BTreeSet<&'static str>>>(self, keywords: T) -> Self
pub fn with_types<T: Into<BTreeSet<&'static str>>>(self, types: T) -> Self
pub fn with_special<T: Into<BTreeSet<&'static str>>>(self, special: T) -> Self
pub fn language(&self) -> &str
pub fn comment(&self) -> &str
pub fn is_hyperlink(&self, word: &str) -> bool
pub fn is_keyword(&self, word: &str) -> bool
pub fn is_type(&self, word: &str) -> bool
pub fn is_special(&self, word: &str) -> bool
Trait Implementations§
impl StructuralPartialEq for Syntax
Auto Trait Implementations§
impl Freeze for Syntax
impl RefUnwindSafe for Syntax
impl Send for Syntax
impl Sync for Syntax
impl Unpin for Syntax
impl UnwindSafe for Syntax
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more