[go: up one dir, main page]

Trait VecHelper

Source
pub trait VecHelper<T> {
    // Required methods
    fn alloc(&mut self) -> VecAllocation<'_, T>;
    fn entry(&mut self, index: usize) -> VecEntry<'_, T>;
}
Expand description

Helper trait for a Vec type that allocates up-front.

Required Methods§

Source

fn alloc(&mut self) -> VecAllocation<'_, T>

Grows the vector by a single entry, returning the allocation.

Source

fn entry(&mut self, index: usize) -> VecEntry<'_, T>

Either returns an existing element, or grows the vector by one. Doesn’t expect indices to be higher than the current length.

Implementations on Foreign Types§

Source§

impl<T> VecHelper<T> for Vec<T>

Source§

fn alloc(&mut self) -> VecAllocation<'_, T>

Source§

fn entry(&mut self, index: usize) -> VecEntry<'_, T>

Implementors§