Struct free_ranges::FreeRanges
[−]
[src]
pub struct FreeRanges { /* fields omitted */ }
Methods
impl FreeRanges
[src]
fn new() -> Self
[src]
Starts empty with no ranges free
fn with_all_free() -> FreeRanges
[src]
Initializes FreeRanges with 0...usize::MAX already free
fn with_initial_range(range: Range) -> FreeRanges
[src]
Initializes FreeRanges with the passed range
already marked as free
fn free_ranges(&self) -> Iter<Range>
[src]
Iterator over all of the contiguous free ranges
fn set_free(&mut self, index: usize) -> bool
[src]
Marks a specific index as free
fn set_used(&mut self, index: usize) -> bool
[src]
Marks a free index as used. Returns false if the index was not free
fn first(&self) -> Option<usize>
[src]
Returns the first free value if one exists
fn set_first_used(&mut self) -> Option<usize>
[src]
Marks the first index in the free list as used and returns it
fn last(&self) -> Option<usize>
[src]
Returns the first free value if one exists
fn set_last_used(&mut self) -> Option<usize>
[src]
Marks the first index in the free list as used and returns it
fn remove_last_contiguous(&mut self)
[src]
Trait Implementations
impl Debug for FreeRanges
[src]
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