pub struct FileMatch {
pub score: u32,
pub path: PathBuf,
pub match_type: MatchType,
pub root: PathBuf,
pub indices: Option<Vec<u32>>,
}Expand description
A single match result returned from the search.
score– Relevance score returned bynucleo.path– Path to the matched entry (file or directory), relative to the search directory.match_type– Whether this match is a file or directory.indices– Optional list of character indices that matched the query. These are only filled when the caller ofrunsetsoptions.compute_indicestotrue. The indices vector follows the guidance fromnucleo::pattern::Pattern::indices: they are unique and sorted in ascending order so that callers can use them directly for highlighting.
Fields§
§score: u32§path: PathBuf§match_type: MatchType§root: PathBuf§indices: Option<Vec<u32>>Implementations§
Trait Implementations§
impl Eq for FileMatch
impl StructuralPartialEq for FileMatch
Auto Trait Implementations§
impl Freeze for FileMatch
impl RefUnwindSafe for FileMatch
impl Send for FileMatch
impl Sync for FileMatch
impl Unpin for FileMatch
impl UnsafeUnpin for FileMatch
impl UnwindSafe for FileMatch
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more