pub struct CollectionExtentIndex { /* private fields */ }Expand description
Variable-height prefix-sum index used by virtual collection policies.
It supports offset lookup, prefix sums, insertion, removal, movement, and extent correction in expected logarithmic time.
Implementations§
Source§impl CollectionExtentIndex
impl CollectionExtentIndex
pub const fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn total(&self) -> f32
pub fn clear(&mut self)
pub fn rebuild(&mut self, extents: impl IntoIterator<Item = f32>)
pub fn insert(&mut self, index: usize, extent: f32)
pub fn insert_many( &mut self, index: usize, extents: impl IntoIterator<Item = f32>, )
pub fn remove(&mut self, index: usize) -> Option<f32>
pub fn move_item(&mut self, from: usize, to: usize) -> bool
pub fn update(&mut self, index: usize, extent: f32) -> bool
pub fn extent(&self, index: usize) -> Option<f32>
pub fn offset_of(&self, index: usize) -> f32
pub fn index_at_offset(&self, offset: f32) -> Option<usize>
Trait Implementations§
Source§impl Debug for CollectionExtentIndex
impl Debug for CollectionExtentIndex
Auto Trait Implementations§
impl Forget for CollectionExtentIndex
impl Freeze for CollectionExtentIndex
impl Move for CollectionExtentIndex
impl RefUnwindSafe for CollectionExtentIndex
impl Send for CollectionExtentIndex
impl Sync for CollectionExtentIndex
impl Unpin for CollectionExtentIndex
impl UnsafeUnpin for CollectionExtentIndex
impl UnwindSafe for CollectionExtentIndex
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