Struct flatvec::Storage[][src]

pub struct Storage<'a, BackingTy> { /* fields omitted */ }

A wrapper over the innards of a FlatVec which exposes mutating operations which cannot corrupt other elements when inserting a new element.

Implementations

impl<BackingTy> Storage<'_, BackingTy> where
    BackingTy: Default
[src]

pub fn allocate(&mut self, requested: usize) -> &mut [BackingTy][src]

Returns a Default slice of BackingTy that will be considered part of this flattened object.

Note that even if you do not use part of this slice, the whole slice will be presented to a FromFlat implementation. This function may be called multiple times in a single IntoFlat implementation or combined with Storage::extend if a flattened object is complex, but it is significantly more efficient to use a single Storage::allocate call where possible.

pub fn reserve(&mut self, requested: usize)[src]

Reserves capacity for at least len additional BackingTy.

pub fn extend<Iter>(&mut self, iter: Iter) where
    Iter: IntoIterator<Item = BackingTy>, 
[src]

Inserts the BackingTy yielded by iter.

In general, due to missed optimizations, this is ~2x slower than calling allocate when the exact size of the inserted object is known.

Auto Trait Implementations

impl<'a, BackingTy> RefUnwindSafe for Storage<'a, BackingTy> where
    BackingTy: RefUnwindSafe

impl<'a, BackingTy> Send for Storage<'a, BackingTy> where
    BackingTy: Send

impl<'a, BackingTy> Sync for Storage<'a, BackingTy> where
    BackingTy: Sync

impl<'a, BackingTy> Unpin for Storage<'a, BackingTy>

impl<'a, BackingTy> !UnwindSafe for Storage<'a, BackingTy>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.