pub struct ThemeConfigParser { /* private fields */ }Expand description
Parses color configuration strings in different syntaxes.
Supports:
- Git color syntax (e.g., “bold red”, “red blue”)
- LS_COLORS syntax (e.g., “01;34” for bold blue)
- Flexible parsing that tries multiple formats
Implementations§
Source§impl ThemeConfigParser
impl ThemeConfigParser
Sourcepub fn parse_git_style(&self, input: &str) -> Result<AnsiStyle>
pub fn parse_git_style(&self, input: &str) -> Result<AnsiStyle>
Sourcepub fn parse_ls_colors(&self, input: &str) -> Result<AnsiStyle>
pub fn parse_ls_colors(&self, input: &str) -> Result<AnsiStyle>
Sourcepub fn parse_flexible(&self, input: &str) -> Result<AnsiStyle>
pub fn parse_flexible(&self, input: &str) -> Result<AnsiStyle>
Parse a style string, attempting Git syntax first, then LS_COLORS as fallback.
This is a convenience function for flexible input parsing. It tries the more human-readable Git syntax first, then falls back to ANSI codes if that fails.
§Errors
Returns error if the input matches neither Git nor LS_COLORS syntax.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ThemeConfigParser
impl RefUnwindSafe for ThemeConfigParser
impl Send for ThemeConfigParser
impl Sync for ThemeConfigParser
impl Unpin for ThemeConfigParser
impl UnsafeUnpin for ThemeConfigParser
impl UnwindSafe for ThemeConfigParser
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