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
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CachedStyleParser
impl Forget for CachedStyleParser
impl Move for CachedStyleParser
impl RefUnwindSafe for CachedStyleParserwhere
Atomic<usize>: RefUnwindSafe,
Atomic<*mut HashMap<String, Style>>: RefUnwindSafe,
Mutex<Slab<Arc<CachePadded<Atomic<usize>>>>>: RefUnwindSafe,
Mutex<WriteHandle<HashMap<String, Style>, MapOp<String, Style>>>: RefUnwindSafe,
impl Send for CachedStyleParser
impl Sync for CachedStyleParser
impl Unpin for CachedStyleParserwhere
Arc<Atomic<*mut HashMap<String, Style>>>: Unpin,
Arc<Mutex<Slab<Arc<CachePadded<Atomic<usize>>>>>>: Unpin,
Align4<u32>: Unpin,
Align1<u8>: Unpin,
*const HashMap<String, Style> is !null: Unpin,
*const u8 is !null: Unpin,
Arc<CachePadded<Atomic<usize>>>: Unpin,
*const HashMap<String, Style>: Unpin,
impl UnsafeUnpin for CachedStyleParserwhere
*const ArcInner<Atomic<*mut HashMap<String, Style>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<*mut HashMap<String, Style>>>>: UnsafeUnpin,
*const ArcInner<Mutex<Slab<Arc<CachePadded<Atomic<usize>>>>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Slab<Arc<CachePadded<Atomic<usize>>>>>>>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const HashMap<String, Style> is !null: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<MapOp<String, Style>>: UnsafeUnpin,
*const ArcInner<CachePadded<Atomic<usize>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<CachePadded<Atomic<usize>>>>: UnsafeUnpin,
PhantomData<*const HashMap<String, Style>>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
impl UnwindSafe for CachedStyleParserwhere
Arc<Atomic<*mut HashMap<String, Style>>>: UnwindSafe,
Arc<Mutex<Slab<Arc<CachePadded<Atomic<usize>>>>>>: UnwindSafe,
Mutex<WriteHandle<HashMap<String, Style>, MapOp<String, Style>>>: UnwindSafe,
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