pub struct TextHighlighter { /* private fields */ }
Implementations§
Source§impl TextHighlighter
impl TextHighlighter
pub fn with_theme(theme_name: &str) -> TextHighlighter
pub fn set_syntax_token(&mut self, syntax_token: &str)
Sourcepub fn select_theme(&mut self, theme_name: &str)
pub fn select_theme(&mut self, theme_name: &str)
set the theme name
pub fn highlight_line<'l>( &mut self, line: &'l str, ) -> Result<Vec<(Style, &'l str)>, Error>
pub fn active_theme(&self) -> &'static Theme
pub fn gutter_background(&self) -> Option<Color>
pub fn gutter_foreground(&self) -> Option<Color>
pub fn theme_background(&self) -> Option<Color>
pub fn theme_foreground(&self) -> Option<Color>
pub fn selection_background(&self) -> Option<Color>
Trait Implementations§
Source§impl Default for TextHighlighter
impl Default for TextHighlighter
Source§fn default() -> TextHighlighter
fn default() -> TextHighlighter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TextHighlighter
impl RefUnwindSafe for TextHighlighter
impl Send for TextHighlighter
impl Sync for TextHighlighter
impl Unpin for TextHighlighter
impl UnwindSafe for TextHighlighter
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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.