Struct range_alloc::RangeAllocator
source · pub struct RangeAllocator<T> { /* private fields */ }
Implementations
sourceimpl<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 allocate_range(
&mut self,
length: T
) -> Result<Range<T>, RangeAllocationError<T>>
pub fn free_range(&mut self, range: Range<T>)
sourcepub fn allocated_ranges<'a>(&'a self) -> impl 'a + Iterator<Item = Range<T>>
pub fn allocated_ranges<'a>(&'a self) -> impl 'a + Iterator<Item = Range<T>>
Returns an iterator over allocated non-empty ranges
pub fn reset(&mut self)
pub fn is_empty(&self) -> bool
sourceimpl<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> 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more