pub struct FindMatch {
pub position: usize,
pub length: usize,
pub matched_text: String,
}Expand description
A single search match.
Fields§
§position: usize§length: usize§matched_text: StringThe text that was actually matched, sliced from the document’s own search text.
Carried here so no caller ever slices it themselves — and with folding on, that is no
longer a convenience. A search for cafe matches café; a search for strasse
matches straße. The query is not the matched text, length is not the query’s
length, and the only other whole-document string a caller can reach
(TextDocument::to_plain_text) does not even use the same offset space — it drops
the U+FFFC anchor an embedded table occupies.
Trait Implementations§
impl Eq for FindMatch
impl StructuralPartialEq for FindMatch
Auto Trait Implementations§
impl Freeze for FindMatch
impl RefUnwindSafe for FindMatch
impl Send for FindMatch
impl Sync for FindMatch
impl Unpin for FindMatch
impl UnsafeUnpin for FindMatch
impl UnwindSafe for FindMatch
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.