pub struct Candidate { /* private fields */ }Expand description
A candidate file that might match a query.
Created by index planning or filesystem walk, then processed through the candidate pipeline for depth, filesize, and metadata constraints. The normalized string path is computed lazily on first access.
Fields are accessible via accessor methods to guarantee that the lazy
rel_str cache remains consistent with rel_path.
Implementations§
Source§impl Candidate
impl Candidate
pub const fn new(rel_path: PathBuf, abs_path: PathBuf) -> Self
pub fn rel_path(&self) -> &Path
pub fn abs_path(&self) -> &Path
Sourcepub fn rel_str(&self) -> &str
pub fn rel_str(&self) -> &str
Normalized relative path string (forward slashes), computed lazily.
pub fn display_path( &self, display: PathDisplay, path_separator: Option<u8>, ) -> String
Sourcepub fn within_depth(&self, max_depth: Option<usize>) -> bool
pub fn within_depth(&self, max_depth: Option<usize>) -> bool
Check depth constraint against a filter’s max depth.
Sourcepub fn within_filesize(&self, max_filesize: Option<u64>) -> bool
pub fn within_filesize(&self, max_filesize: Option<u64>) -> bool
Check filesize constraint against a filter’s max filesize.
Sourcepub fn matches(&self, filter: &CandidateFilter) -> bool
pub fn matches(&self, filter: &CandidateFilter) -> bool
Check all configured filter rules: depth, filesize, and path-based rules.
Trait Implementations§
impl Eq for Candidate
Auto Trait Implementations§
impl !Freeze for Candidate
impl RefUnwindSafe for Candidate
impl Send for Candidate
impl Sync for Candidate
impl Unpin for Candidate
impl UnsafeUnpin for Candidate
impl UnwindSafe for Candidate
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