Struct flatvec::Storage [−][src]
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]
BackingTy: Default,
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]
Iter: IntoIterator<Item = BackingTy>,
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,
BackingTy: RefUnwindSafe,
impl<'a, BackingTy> Send for Storage<'a, BackingTy> where
BackingTy: Send,
BackingTy: Send,
impl<'a, BackingTy> Sync for Storage<'a, BackingTy> where
BackingTy: Sync,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,