Struct range_alloc::RangeAllocator
source · pub struct RangeAllocator<T> { /* private fields */ }
Implementations§
source§impl<T> RangeAllocator<T>where
T: Clone + Copy + Add<Output = T> + AddAssign + Sub<Output = T> + Eq + PartialOrd + Debug,
impl<T> RangeAllocator<T>where T: Clone + Copy + Add<Output = T> + AddAssign + Sub<Output = T> + Eq + PartialOrd + Debug,
pub fn new(range: Range<T>) -> Self
pub fn initial_range(&self) -> &Range<T>
pub fn grow_to(&mut self, new_end: T)
pub fn allocate_range( &mut self, length: T ) -> Result<Range<T>, RangeAllocationError<T>>
pub fn free_range(&mut self, range: Range<T>)
sourcepub fn allocated_ranges(&self) -> impl Iterator<Item = Range<T>> + '_
pub fn allocated_ranges(&self) -> impl Iterator<Item = Range<T>> + '_
Returns an iterator over allocated non-empty ranges