Struct storage_api::RawVec
source · [−]pub struct RawVec<T, S: Storage> { /* private fields */ }
Expand description
A raw vec around some slice storage. Bundles the storage and its handle.
Note that this is even lower level than alloc’s RawVec
currently. That
raw vec handles amortized growth; this raw vec just does exactly as asked.
Implementations
sourceimpl<T, S: Storage> RawVec<T, S>
impl<T, S: Storage> RawVec<T, S>
sourcepub fn new(storage: S) -> Result<Self, S>
pub fn new(storage: S) -> Result<Self, S>
Create a new empty growable slice in the given storage.
sourcepub fn as_ref(&self) -> &[MaybeUninit<T>]
pub fn as_ref(&self) -> &[MaybeUninit<T>]
Get a reference to the boxed slice.
sourcepub fn as_mut(&mut self) -> &mut [MaybeUninit<T>]
pub fn as_mut(&mut self) -> &mut [MaybeUninit<T>]
Get a mutable reference to the boxed slice.
Trait Implementations
Auto Trait Implementations
impl<T, S> RefUnwindSafe for RawVec<T, S> where
S: RefUnwindSafe,
<S as Storage>::Handle: RefUnwindSafe,
impl<T, S> Send for RawVec<T, S> where
S: Send,
impl<T, S> Sync for RawVec<T, S> where
S: Sync,
impl<T, S> Unpin for RawVec<T, S> where
S: Unpin,
impl<T, S> UnwindSafe for RawVec<T, S> where
S: UnwindSafe,
<S as Storage>::Handle: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more