pub struct SyntaxHighlighter { /* private fields */ }Expand description
A reusable syntax highlighter. Least-recently-used entries are evicted when full.
Implementations§
Source§impl SyntaxHighlighter
impl SyntaxHighlighter
Sourcepub fn new(config: impl Into<CacheConfig>) -> Self
pub fn new(config: impl Into<CacheConfig>) -> Self
Creates a highlighter with fixed cache resource limits.
pub const fn stats(&self) -> HighlightStats
pub fn reset_stats(&mut self)
Sourcepub fn take_stats(&mut self) -> HighlightStats
pub fn take_stats(&mut self) -> HighlightStats
Atomically returns all counters accumulated so far and resets them.
pub const fn config(&self) -> CacheConfig
pub fn with_theme<'a>( &'a mut self, theme: &'a SyntaxTheme, ) -> ThemedHighlighter<'a>
pub fn cache_usage(&self) -> CacheUsage
pub fn clear_cache(&mut self)
Trait Implementations§
Source§impl Debug for SyntaxHighlighter
impl Debug for SyntaxHighlighter
Auto Trait Implementations§
impl Freeze for SyntaxHighlighter
impl RefUnwindSafe for SyntaxHighlighter
impl Send for SyntaxHighlighter
impl Sync for SyntaxHighlighter
impl Unpin for SyntaxHighlighter
impl UnsafeUnpin for SyntaxHighlighter
impl UnwindSafe for SyntaxHighlighter
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