Trait orx_split_vec::Growth
source · pub trait Growth: Clone {
// Required method
fn new_fragment_capacity<T>(&self, fragments: &[Fragment<T>]) -> usize;
// Provided method
fn get_fragment_and_inner_indices<T>(
&self,
_vec_len: usize,
fragments: &[Fragment<T>],
element_index: usize
) -> Option<(usize, usize)> { ... }
}Expand description
Growth strategy of a split vector.
Required Methods§
sourcefn new_fragment_capacity<T>(&self, fragments: &[Fragment<T>]) -> usize
fn new_fragment_capacity<T>(&self, fragments: &[Fragment<T>]) -> usize
Given that the split vector contains the given fragments,
returns the capacity of the next fragment.
Provided Methods§
sourcefn get_fragment_and_inner_indices<T>(
&self,
_vec_len: usize,
fragments: &[Fragment<T>],
element_index: usize
) -> Option<(usize, usize)>
fn get_fragment_and_inner_indices<T>( &self, _vec_len: usize, 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.
Object Safety§
This trait is not object safe.