pub struct UsizeCOSetBuilder { /* private fields */ }Expand description
Concurrent write-side builder for UsizeCOSet.
Insertions are expected O(log n) through crossbeam_skiplist.
No merging is performed during insertion; normalization happens once
in seal.
Implementations§
Source§impl UsizeCOSetBuilder
impl UsizeCOSetBuilder
Sourcepub fn insert(&self, iv: UsizeCO)
pub fn insert(&self, iv: UsizeCO)
Inserts one interval into the builder.
This method is safe to call concurrently through shared references.
Identical intervals are deduplicated by the underlying SkipSet.
Sourcepub fn seal(self) -> UsizeCOSet
pub fn seal(self) -> UsizeCOSet
Consumes the builder and returns a canonical immutable set.
The merge process is linear over the sorted skip-list iterator:
- maintain one pending interval
cur; - if the next interval overlaps or is adjacent, replace
curwith its convex hull; - otherwise, push
curand start a new pending interval; - finally, push the last pending interval.
Trait Implementations§
Source§impl Debug for UsizeCOSetBuilder
impl Debug for UsizeCOSetBuilder
Source§impl Default for UsizeCOSetBuilder
impl Default for UsizeCOSetBuilder
Source§fn default() -> UsizeCOSetBuilder
fn default() -> UsizeCOSetBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for UsizeCOSetBuilder
impl !RefUnwindSafe for UsizeCOSetBuilder
impl Send for UsizeCOSetBuilder
impl Sync for UsizeCOSetBuilder
impl Unpin for UsizeCOSetBuilder
impl UnsafeUnpin for UsizeCOSetBuilder
impl !UnwindSafe for UsizeCOSetBuilder
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