pub struct ColorApplier { /* private fields */ }Expand description
颜色应用器
Implementations§
Source§impl ColorApplier
impl ColorApplier
Sourcepub fn new(config: ColorConfig) -> Self
pub fn new(config: ColorConfig) -> Self
创建新的颜色应用器
Sourcepub fn apply_level_color(&self, _level: &str, text: &str) -> String
pub fn apply_level_color(&self, _level: &str, text: &str) -> String
应用级别颜色
Sourcepub fn apply_keyword_color(&self, _keyword: &str, text: &str) -> String
pub fn apply_keyword_color(&self, _keyword: &str, text: &str) -> String
应用关键词颜色
Sourcepub fn apply_timestamp_color(&self, text: &str) -> String
pub fn apply_timestamp_color(&self, text: &str) -> String
应用时间戳颜色
Sourcepub fn apply_filename_color(&self, text: &str) -> String
pub fn apply_filename_color(&self, text: &str) -> String
应用文件名颜色
Sourcepub fn apply_line_number_color(&self, text: &str) -> String
pub fn apply_line_number_color(&self, text: &str) -> String
应用行号颜色
Sourcepub fn supports_color() -> bool
pub fn supports_color() -> bool
检测终端是否支持颜色
Sourcepub fn set_override(&self, _enabled: bool)
pub fn set_override(&self, _enabled: bool)
强制启用/禁用颜色
Auto Trait Implementations§
impl Freeze for ColorApplier
impl RefUnwindSafe for ColorApplier
impl Send for ColorApplier
impl Sync for ColorApplier
impl Unpin for ColorApplier
impl UnsafeUnpin for ColorApplier
impl UnwindSafe for ColorApplier
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