pub struct RangeObjectMap<T> {
v: Vec<Elem<T>>,
}Fields§
§v: Vec<Elem<T>>Implementations§
Source§impl<T> RangeObjectMap<T>
impl<T> RangeObjectMap<T>
pub fn new() -> Self
Sourcefn find_offset(&self, offset: Size) -> Result<usize, usize>
fn find_offset(&self, offset: Size) -> Result<usize, usize>
Finds the position of the allocation containing the given offset. If the offset is not in an existing allocation, then returns Err containing the position where such allocation should be inserted
Sourcepub fn access_type(&self, range: AllocRange) -> AccessType
pub fn access_type(&self, range: AllocRange) -> AccessType
Determines whether a given access on range overlaps with
an existing allocation
Sourcepub fn insert_at_pos(&mut self, pos: usize, range: AllocRange, data: T)
pub fn insert_at_pos(&mut self, pos: usize, range: AllocRange, data: T)
Inserts an object and its occupied range at given position
pub fn remove_pos_range(&mut self, pos_range: Range<usize>)
pub fn remove_from_pos(&mut self, pos: usize) -> T
pub fn iter(&self) -> impl Iterator<Item = &T>
pub fn range(&self, range: AllocRange) -> impl Iterator<Item = &T>
pub fn remove_range_if(&mut self, range: AllocRange, pred: impl Fn(&T) -> bool)
Sourcepub fn get_start(&self, offset: Size) -> Option<&T>
pub fn get_start(&self, offset: Size) -> Option<&T>
Get the element that starts at the given offset.
Sourcepub fn get_start_mut(&mut self, offset: Size) -> Option<&mut T>
pub fn get_start_mut(&mut self, offset: Size) -> Option<&mut T>
Get the element that starts at the given offset.
pub fn get_pos(&self, pos: usize) -> Option<&T>
pub fn get_mut_pos(&mut self, pos: usize) -> Option<&mut T>
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl<T: Clone> Clone for RangeObjectMap<T>
impl<T: Clone> Clone for RangeObjectMap<T>
Auto Trait Implementations§
impl<T> DynSend for RangeObjectMap<T>
impl<T> DynSync for RangeObjectMap<T>
impl<T> Forget for RangeObjectMap<T>
impl<T> Freeze for RangeObjectMap<T>
impl<T> Move for RangeObjectMap<T>
impl<T> RefUnwindSafe for RangeObjectMap<T>
impl<T> Send for RangeObjectMap<T>
impl<T> Sync for RangeObjectMap<T>
impl<T> Unpin for RangeObjectMap<T>
impl<T> UnsafeUnpin for RangeObjectMap<T>
impl<T> UnwindSafe for RangeObjectMap<T>
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,
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