pub struct SearchMatch {
pub start: u32,
pub end: u32,
}Expand description
A highlighted range inside a snippet.
Offsets are UTF-16 code units, counted from the start of the snippet —
the client’s unit, not Rust’s: the frontend slices with
String.prototype.slice, so byte offsets or code-point counts would misplace
every highlight in a snippet containing an astral-plane character, and only
there. See Highlight in libs/react/src/components/Highlight/Highlight.tsx.
Ranges are ascending, non-overlapping, and half-open (start..end).
Fields§
§start: u32§end: u32Trait Implementations§
Source§impl Clone for SearchMatch
impl Clone for SearchMatch
Source§fn clone(&self) -> SearchMatch
fn clone(&self) -> SearchMatch
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SearchMatch
Source§impl Debug for SearchMatch
impl Debug for SearchMatch
Auto Trait Implementations§
impl Freeze for SearchMatch
impl RefUnwindSafe for SearchMatch
impl Send for SearchMatch
impl Sync for SearchMatch
impl Unpin for SearchMatch
impl UnsafeUnpin for SearchMatch
impl UnwindSafe for SearchMatch
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