Struct broot::display::MatchedString
source · pub struct MatchedString<'a> {
pub name_match: Option<NameMatch>,
pub string: &'a str,
pub base_style: &'a CompoundStyle,
pub match_style: &'a CompoundStyle,
pub display_width: Option<usize>,
pub align: Alignment,
}
Fields§
§name_match: Option<NameMatch>
§string: &'a str
§base_style: &'a CompoundStyle
§match_style: &'a CompoundStyle
§display_width: Option<usize>
§align: Alignment
Implementations§
source§impl<'a, 'w> MatchedString<'a>
impl<'a, 'w> MatchedString<'a>
pub fn new(
name_match: Option<NameMatch>,
string: &'a str,
base_style: &'a CompoundStyle,
match_style: &'a CompoundStyle
) -> Self
sourcepub fn split_on_last(&mut self, sep: char) -> Option<Self>
pub fn split_on_last(&mut self, sep: char) -> Option<Self>
If the string contains sep, then cut the tail of this matched string and return it. Note: a non none display_width currently prevents splitting (i.e. it’s not yet implemented and would involve compute width)