pub struct CachedStyleParser { /* private fields */ }Expand description
Thread-safe cached parser for Git and LS_COLORS style strings
Implementations§
Source§impl CachedStyleParser
impl CachedStyleParser
Sourcepub fn parse_git_style(&self, input: &str) -> Result<AnsiStyle>
pub fn parse_git_style(&self, input: &str) -> Result<AnsiStyle>
Parse and cache a Git-style color string (e.g., “bold red blue”)
Sourcepub fn parse_ls_colors(&self, input: &str) -> Result<AnsiStyle>
pub fn parse_ls_colors(&self, input: &str) -> Result<AnsiStyle>
Parse and cache an LS_COLORS-style string (e.g., “01;34”)
Sourcepub fn parse_flexible(&self, input: &str) -> Result<AnsiStyle>
pub fn parse_flexible(&self, input: &str) -> Result<AnsiStyle>
Parse using Git syntax first, then LS_COLORS as fallback, with caching
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clear all cached styles
Sourcepub fn cache_stats(&self) -> (usize, usize)
pub fn cache_stats(&self) -> (usize, usize)
Get cache statistics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CachedStyleParser
impl RefUnwindSafe for CachedStyleParser
impl Send for CachedStyleParser
impl Sync for CachedStyleParser
impl Unpin for CachedStyleParser
impl UnsafeUnpin for CachedStyleParser
impl UnwindSafe for CachedStyleParser
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more