Fields§
§v: Vec<Elem<T>>
Implementations§
source§impl<T> RangeMap<T>
impl<T> RangeMap<T>
sourcepub fn new(size: Size, init: T) -> RangeMap<T>
pub fn new(size: Size, init: T) -> RangeMap<T>
Creates a new RangeMap
for the given size, and with the given initial value used for
the entire range.
sourcefn find_offset(&self, offset: u64) -> usize
fn find_offset(&self, offset: u64) -> usize
Finds the index containing the given offset.
sourcepub fn iter(&self, offset: Size, len: Size) -> impl Iterator<Item = (Size, &T)>
pub fn iter(&self, offset: Size, len: Size) -> impl Iterator<Item = (Size, &T)>
Provides read-only iteration over everything in the given range. This does not split items if they overlap with the edges. Do not use this to mutate through interior mutability.
The iterator also provides the offset of the given element.
pub fn iter_mut_all(&mut self) -> impl Iterator<Item = &mut T>
pub fn iter_all(&self) -> impl Iterator<Item = (Range<u64>, &T)>
fn split_index(&mut self, index: usize, split_offset: u64) -> boolwhere
T: Clone,
sourcepub fn iter_mut(
&mut self,
offset: Size,
len: Size
) -> impl Iterator<Item = (Size, &mut T)>where
T: Clone + PartialEq,
pub fn iter_mut(
&mut self,
offset: Size,
len: Size
) -> impl Iterator<Item = (Size, &mut T)>where
T: Clone + PartialEq,
Provides mutable iteration over everything in the given range. As a side-effect, this will split entries in the map that are only partially hit by the given range, to make sure that when they are mutated, the effect is constrained to the given range. Moreover, this will opportunistically merge neighbouring equal blocks.
The iterator also provides the offset of the given element.
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for RangeMap<T>where
T: RefUnwindSafe,
impl<T> Send for RangeMap<T>where
T: Send,
impl<T> Sync for RangeMap<T>where
T: Sync,
impl<T> Unpin for RangeMap<T>where
T: Unpin,
impl<T> UnwindSafe for RangeMap<T>where
T: UnwindSafe,
Blanket Implementations§
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes