Trait orx_split_vec::SplitVecGrowth
source · pub trait SplitVecGrowth<T>: Clone {
// Required methods
fn new_fragment_capacity(&self, fragments: &[Fragment<T>]) -> usize;
fn get_fragment_and_inner_indices(
&self,
fragments: &[Fragment<T>],
element_index: usize
) -> Option<(usize, usize)>;
}Expand description
Growth strategy of a split vector.
Required Methods§
sourcefn new_fragment_capacity(&self, fragments: &[Fragment<T>]) -> usize
fn new_fragment_capacity(&self, fragments: &[Fragment<T>]) -> usize
Given that the split vector contains the given fragments,
returns the capacity of the next fragment.
sourcefn get_fragment_and_inner_indices(
&self,
fragments: &[Fragment<T>],
element_index: usize
) -> Option<(usize, usize)>
fn get_fragment_and_inner_indices( &self, fragments: &[Fragment<T>], element_index: usize ) -> Option<(usize, usize)>
Returns the location of the element with the given element_index on the split vector
as a tuple of (fragment-index, index-within-fragment).
Returns None if the element index is out of bounds.