pub struct HighlightScheme { /* private fields */ }
Implementations§
Source§impl HighlightScheme
impl HighlightScheme
pub fn new(regex_expr: &str, color: &str, style: Styles) -> Result<Self, Error>
pub fn builder(regex_expr: &str) -> Result<HighlightSchemeBuilder, Error>
Sourcepub fn format_whole_slice(&self, string_to_format: &str) -> String
pub fn format_whole_slice(&self, string_to_format: &str) -> String
This function formats the whole slice passed to it, it does not re-check the regex.
Sourcepub fn format_line(&self, line_to_format: &str) -> String
pub fn format_line(&self, line_to_format: &str) -> String
this function does the regex search and formats the correct parts of the line and returns them as a new string.
N.B. this function might behave oddly if passed slices of multiple lines.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HighlightScheme
impl RefUnwindSafe for HighlightScheme
impl Send for HighlightScheme
impl Sync for HighlightScheme
impl Unpin for HighlightScheme
impl UnwindSafe for HighlightScheme
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