pub struct RangeSet { /* private fields */ }Implementations§
Source§impl RangeSet
impl RangeSet
pub fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn min(&self) -> Option<u64>
pub fn iter(&self) -> impl DoubleEndedIterator<Item = (u64, u64)> + '_
pub fn first(&self) -> Option<(u64, u64)>
pub fn contains(&self, v: u64) -> bool
Sourcepub fn contains_range(&self, s: u64, e: u64) -> bool
pub fn contains_range(&self, s: u64, e: u64) -> bool
True if all of [s, e) is in the set.
Sourcepub fn insert(&mut self, s: u64, e: u64) -> bool
pub fn insert(&mut self, s: u64, e: u64) -> bool
Inserts [s, e); returns true if anything new was added.
Sourcepub fn remove_below(&mut self, v: u64)
pub fn remove_below(&mut self, v: u64)
Removes everything below v.
Sourcepub fn truncate_low(&mut self, n: usize)
pub fn truncate_low(&mut self, n: usize)
Drops the lowest ranges so at most n remain.
Sourcepub fn pop_min(&mut self, max_len: u64) -> Option<(u64, u64)>
pub fn pop_min(&mut self, max_len: u64) -> Option<(u64, u64)>
Removes and returns the lowest range, clipped to at most max_len values.
pub fn clear(&mut self)
Trait Implementations§
impl Eq for RangeSet
impl StructuralPartialEq for RangeSet
Auto Trait Implementations§
impl Forget for RangeSet
impl Freeze for RangeSet
impl Move for RangeSet
impl RefUnwindSafe for RangeSet
impl Send for RangeSet
impl Sync for RangeSet
impl Unpin for RangeSet
impl UnsafeUnpin for RangeSet
impl UnwindSafe for RangeSet
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