Struct storage_api::Box
source · [−]Expand description
A pointer type for heap allocation. A tiny subset of std’s Box.
Implementations
sourceimpl<'a, U> Box<U, DynStorage<'a>> where
U: ?Sized + Pointee<Metadata = DynMetadata<U>>,
impl<'a, U> Box<U, DynStorage<'a>> where
U: ?Sized + Pointee<Metadata = DynMetadata<U>>,
sourcepub fn boxed<A>(boxed: Box<U, AllocStorage<A>>) -> Self where
A: Copy + Allocator,
Bool<{ is_zst::<A>() }>: True,
pub fn boxed<A>(boxed: Box<U, AllocStorage<A>>) -> Self where
A: Copy + Allocator,
Bool<{ is_zst::<A>() }>: True,
Construct a dynamic storage box from a standard box.
sourcepub fn inline(boxed: Box<U, InlineStorage<usize>>) -> Self
pub fn inline(boxed: Box<U, InlineStorage<usize>>) -> Self
Construct a dynamic storage box inline.
sourcepub unsafe fn take(taken: &'a mut ManuallyDrop<U>) -> Self
pub unsafe fn take(taken: &'a mut ManuallyDrop<U>) -> Self
Construct a dynamic storage box by taking someone else’s allocation.
Trait Implementations
sourceimpl<T, U: ?Sized, S: Storage> CoerciblePtr<U> for Box<T, S>
impl<T, U: ?Sized, S: Storage> CoerciblePtr<U> for Box<T, S>
type Pointee = T
type Pointee = T
The type we point to. This influences which kinds of unsizing are possible. Read more
sourcefn as_sized_ptr(&mut self) -> *mut Self::Pointee
fn as_sized_ptr(&mut self) -> *mut Self::Pointee
Get the raw inner pointer.
sourceunsafe fn replace_ptr(self, ptr: *mut U) -> Self::Output
unsafe fn replace_ptr(self, ptr: *mut U) -> Self::Output
Replace the container inner pointer with an unsized version. Read more
Auto Trait Implementations
impl<T: ?Sized, S> RefUnwindSafe for Box<T, S> where
S: RefUnwindSafe,
<S as Storage>::Handle: RefUnwindSafe,
<T as Pointee>::Metadata: RefUnwindSafe,
impl<T: ?Sized, S> Send for Box<T, S> where
S: Send,
impl<T: ?Sized, S> Sync for Box<T, S> where
S: Sync,
impl<T: ?Sized, S> Unpin for Box<T, S> where
S: Unpin,
impl<T: ?Sized, S> UnwindSafe for Box<T, S> where
S: UnwindSafe,
<S as Storage>::Handle: UnwindSafe,
<T as Pointee>::Metadata: 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