Struct coca::storage::AllocStorage
source · [−]pub struct AllocStorage<R: LayoutSpec> { /* private fields */ }
This is supported on crate feature
alloc
only.Expand description
A fat pointer to a heap-allocated storage block conforming to a LayoutSpec
.
Implementations
sourceimpl<R: LayoutSpec> AllocStorage<R>
impl<R: LayoutSpec> AllocStorage<R>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Allocates a new storage block with the specified capacity with the global allocator.
Panics
Panics if capacity
is large enough to cause a layout error, or if
allocation fails.
Trait Implementations
sourceimpl<R: LayoutSpec> Drop for AllocStorage<R>
impl<R: LayoutSpec> Drop for AllocStorage<R>
sourceimpl<R: LayoutSpec> Storage<R> for AllocStorage<R>
impl<R: LayoutSpec> Storage<R> for AllocStorage<R>
Auto Trait Implementations
impl<R> RefUnwindSafe for AllocStorage<R> where
R: RefUnwindSafe,
impl<R> !Send for AllocStorage<R>
impl<R> !Sync for AllocStorage<R>
impl<R> Unpin for AllocStorage<R> where
R: Unpin,
impl<R> UnwindSafe for AllocStorage<R> where
R: 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