Struct reedline::SimpleMatchHighlighter
source · [−]pub struct SimpleMatchHighlighter { /* private fields */ }
Expand description
Highlight all matches for a given search string in a line
Default style:
- non-matching text: Default style
- matching text: Green foreground color
Implementations
sourceimpl SimpleMatchHighlighter
impl SimpleMatchHighlighter
sourcepub fn new(query: String) -> Self
pub fn new(query: String) -> Self
Create a simple highlighter that styles every exact match of query
.
sourcepub fn with_query(self, query: String) -> Self
pub fn with_query(self, query: String) -> Self
Update query string to match
sourcepub fn with_match_style(self, match_style: Style) -> Self
pub fn with_match_style(self, match_style: Style) -> Self
Set style for the matches found
sourcepub fn with_neutral_style(self, neutral_style: Style) -> Self
pub fn with_neutral_style(self, neutral_style: Style) -> Self
Set style for the text that does not match the query
Trait Implementations
sourceimpl Default for SimpleMatchHighlighter
impl Default for SimpleMatchHighlighter
sourceimpl Highlighter for SimpleMatchHighlighter
impl Highlighter for SimpleMatchHighlighter
Auto Trait Implementations
impl RefUnwindSafe for SimpleMatchHighlighter
impl Send for SimpleMatchHighlighter
impl Sync for SimpleMatchHighlighter
impl Unpin for SimpleMatchHighlighter
impl UnwindSafe for SimpleMatchHighlighter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more