pub struct RangeAllocator<T> { /* private fields */ }
Implementations§
Source§impl<T> RangeAllocator<T>
impl<T> RangeAllocator<T>
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
pub fn reset(&mut self)
pub fn is_empty(&self) -> bool
Source§impl<T: Copy + Sub<Output = T> + Sum> RangeAllocator<T>
impl<T: Copy + Sub<Output = T> + Sum> RangeAllocator<T>
pub fn total_available(&self) -> T
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for RangeAllocator<T>where
T: Freeze,
impl<T> RefUnwindSafe for RangeAllocator<T>where
T: RefUnwindSafe,
impl<T> Send for RangeAllocator<T>where
T: Send,
impl<T> Sync for RangeAllocator<T>where
T: Sync,
impl<T> Unpin for RangeAllocator<T>where
T: Unpin,
impl<T> UnwindSafe for RangeAllocator<T>where
T: UnwindSafe,
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