pub struct PositionSet { /* private fields */ }Expand description
A set of usize positions stored as a BitSet. Provides O(1) membership testing and efficient set operations. Caches bounds for cheap overlap pre-checks.
Implementations§
Source§impl PositionSet
impl PositionSet
Sourcepub fn from_usize_iter<I: IntoIterator<Item = usize>>(iter: I) -> Self
pub fn from_usize_iter<I: IntoIterator<Item = usize>>(iter: I) -> Self
Create a PositionSet from an iterator of usize positions.
Sourcepub fn may_overlap_range(&self, range_start: usize, range_end: usize) -> bool
pub fn may_overlap_range(&self, range_start: usize, range_end: usize) -> bool
Quick check if a range [range_start, range_end) might overlap with this set. Returns true if the bounding boxes overlap, false if they definitely don’t. This is O(1) and used as a pre-filter before the expensive BitSet check.
Sourcepub fn difference(&self, other: &PositionSet) -> PositionSet
pub fn difference(&self, other: &PositionSet) -> PositionSet
Return the difference (elements in self but not in other).
Trait Implementations§
Source§impl Clone for PositionSet
impl Clone for PositionSet
Source§fn clone(&self) -> PositionSet
fn clone(&self) -> PositionSet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PositionSet
impl Debug for PositionSet
Source§impl Default for PositionSet
impl Default for PositionSet
Source§impl FromIterator<usize> for PositionSet
impl FromIterator<usize> for PositionSet
Auto Trait Implementations§
impl Freeze for PositionSet
impl RefUnwindSafe for PositionSet
impl Send for PositionSet
impl Sync for PositionSet
impl Unpin for PositionSet
impl UnsafeUnpin for PositionSet
impl UnwindSafe for PositionSet
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