pub struct Colorizer { /* private fields */ }Expand description
Color engine wrapping LS_COLORS / defaults.
Implementations§
Source§impl Colorizer
impl Colorizer
Sourcepub fn from_ls_colors(enabled: bool, ls_colors: &str) -> Self
pub fn from_ls_colors(enabled: bool, ls_colors: &str) -> Self
Build with an explicit LS_COLORS string (tests / overrides).
pub fn enabled(&self) -> bool
Sourcepub fn paint_name(&self, entry: &Entry, text: &str) -> String
pub fn paint_name(&self, entry: &Entry, text: &str) -> String
Colorize a display name for an entry using full LS_COLORS matching.
Sourcepub fn style_for_entry<'a>(&'a self, entry: &'a Entry) -> Option<&'a Style>
pub fn style_for_entry<'a>(&'a self, entry: &'a Entry) -> Option<&'a Style>
Resolve LS_COLORS style for an entry (extension, type indicators, etc.).
pub fn paint_git_char(&self, ch: char) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Colorizer
impl RefUnwindSafe for Colorizer
impl Send for Colorizer
impl Sync for Colorizer
impl Unpin for Colorizer
impl UnsafeUnpin for Colorizer
impl UnwindSafe for Colorizer
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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