Struct free_ranges::FreeRanges
[−]
[src]
pub struct FreeRanges { /* fields omitted */ }
Methods
impl FreeRanges
[src]
pub fn new() -> Self
[src]
Starts empty with no ranges free
pub fn with_all_free() -> FreeRanges
[src]
Initializes FreeRanges with 0...usize::MAX already free
pub fn with_initial_range(range: Range) -> FreeRanges
[src]
Initializes FreeRanges with the passed range
already marked as free
pub fn free_ranges(&self) -> Iter<Range>
[src]
Iterator over all of the contiguous free ranges
pub fn free_ranges_after(&self, start: usize) -> Range<Range>
[src]
Iterator over all of the ranges starting at a specific index. It will include the first range that contains the index if it exists.
pub fn free_ranges_before(&self, end: usize) -> Range<Range>
[src]
Iterator over all of the ranges ending at a specific index. It will include the last range that contains the index if it exists.
pub fn set_free(&mut self, index: usize) -> bool
[src]
Marks a specific index as free
pub fn set_range_free(&mut self, range: Range) -> bool
[src]
pub fn set_used(&mut self, index: usize) -> bool
[src]
Marks a free index as used. Returns false if the index was not free
pub fn first(&self) -> Option<usize>
[src]
Returns the first free value if one exists
pub fn set_first_used(&mut self) -> Option<usize>
[src]
Marks the first index in the free list as used and returns it
pub fn last(&self) -> Option<usize>
[src]
Returns the first free value if one exists
pub fn set_last_used(&mut self) -> Option<usize>
[src]
Marks the first index in the free list as used and returns it
pub fn remove_last_contiguous(&mut self)
[src]
pub fn is_free(&self, index: usize) -> bool
[src]
pub fn clear(&mut self)
[src]
Trait Implementations
impl Debug for FreeRanges
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for FreeRanges
[src]
fn clone(&self) -> FreeRanges
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for FreeRanges
[src]
fn default() -> FreeRanges
[src]
Returns the "default value" for a type. Read more