pub struct ConflictResolver;Expand description
Detects overlapping or otherwise conflicting matches within a single file.
Implementations§
Source§impl ConflictResolver
impl ConflictResolver
Sourcepub fn detect_conflicts(matches: &[Match]) -> Vec<Conflict>
pub fn detect_conflicts(matches: &[Match]) -> Vec<Conflict>
Detect conflicts among a set of matches.
Two matches conflict if their byte ranges overlap. The returned
Conflict entries reference the indices into the input matches
slice.
Sourcepub fn resolve_greedy(matches: &[Match]) -> Vec<usize>
pub fn resolve_greedy(matches: &[Match]) -> Vec<usize>
Filter out conflicting matches, keeping only non-overlapping ones.
Uses a greedy strategy: iterate matches sorted by start offset and keep a match only if it does not overlap with the previously kept one.
Auto Trait Implementations§
impl Freeze for ConflictResolver
impl RefUnwindSafe for ConflictResolver
impl Send for ConflictResolver
impl Sync for ConflictResolver
impl Unpin for ConflictResolver
impl UnsafeUnpin for ConflictResolver
impl UnwindSafe for ConflictResolver
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> 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