Trait cl_generic_vec::raw::Storage[][src]

pub unsafe trait Storage: AsRef<[MaybeUninit<Self::Item>]> + AsMut<[MaybeUninit<Self::Item>]> {
    type Item;
    fn reserve(&mut self, new_capacity: usize);
fn try_reserve(&mut self, new_capacity: usize) -> AllocResult; }
Expand description

A type that can hold Ts, and potentially reserve space for more Self::Itemss

Safety

Other safe types rely on this trait being implemented correctly. See the safety requirements on each function

Associated Types

The type of item that this storage can contain

Required methods

Reserves space for at least new_capacity elements

Safety

After this call successfully ends, the capacity must be at least new_capacity

Panic/Abort

Maybe panic or abort if it is impossible to set the capacity to at least new_capacity

Tries to reserve space for at least new_capacity elements

Returns Ok(()) on success, Err(AllocError) if it is impossible to set the capacity to at least new_capacity

Safety

If Ok(()) is returned, the capacity must be at least new_capacity

Implementations on Foreign Types

Implementors