#[non_exhaustive]pub struct Highlight {
pub ranges: Vec<MatchRange>,
pub aligned: MatchRange,
pub cost: Cost,
pub cells: usize,
}Expand description
The highlighting of one hit.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ranges: Vec<MatchRange>The highlighted spans of the source string: sorted, disjoint, never empty and never touching (at least one character between two spans).
aligned: MatchRangeThe span of the source string the query was aligned with: the whole
term in HighlightMode::Whole, the matched prefix in
HighlightMode::Prefix. Every range lies within it.
cost: CostThe cost of the alignment behind the ranges: always equal to the
hit’s Hit::cost.
cells: usizeDynamic-programming cells computed (the deterministic work counter).
Trait Implementations§
impl Eq for Highlight
impl StructuralPartialEq for Highlight
Auto Trait Implementations§
impl Freeze for Highlight
impl RefUnwindSafe for Highlight
impl Send for Highlight
impl Sync for Highlight
impl Unpin for Highlight
impl UnsafeUnpin for Highlight
impl UnwindSafe for Highlight
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