pub enum Candidate {
None,
Match(Match),
PossibleStartOfMatch(usize),
}
Expand description
A candidate is the result of running a prefilter on a haystack at a particular position.
The result is either no match, a confirmed match or a possible match.
When no match is returned, the prefilter is guaranteeing that no possible match can be found in the haystack, and the caller may trust this. That is, all correct prefilters must never report false negatives.
In some cases, a prefilter can confirm a match very quickly, in which case, the caller may use this to stop what it’s doing and report the match. In this case, prefilter implementations must never report a false positive. In other cases, the prefilter can only report a potential match, in which case the callers must attempt to confirm the match. In this case, prefilter implementations are permitted to return false positives.
Variants§
None
No match was found. Since false negatives are not possible, this means the search can quit as it is guaranteed not to find another match.
Match(Match)
A confirmed match was found. Callers do not need to confirm it.
PossibleStartOfMatch(usize)
The start of a possible match was found. Callers must confirm it before reporting it as a match.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Candidate
impl RefUnwindSafe for Candidate
impl Send for Candidate
impl Sync for Candidate
impl Unpin 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)