Struct supercow::ext::BoxedStorage
[−]
[src]
pub struct BoxedStorage;
Causes the OWNED or SHARED value of a Supercow to be stored in a
Box.
This makes allocation of owned Supercows more expensive, but incurs zero
space overhead within the Supercow. It also results in a faster Deref
implementation.
Trait Implementations
impl Debug for BoxedStorage[src]
impl Clone for BoxedStorage[src]
fn clone(&self) -> BoxedStorage
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl Copy for BoxedStorage[src]
impl Default for BoxedStorage[src]
fn default() -> BoxedStorage
Returns the "default value" for a type. Read more
impl<A, B> OwnedStorage<A, B> for BoxedStorage[src]
fn allocate_a(&mut self, value: A) -> *mut ()
Allocates the given owned value. Read more
fn allocate_b(&mut self, value: B) -> *mut ()
See allocate_a.
unsafe fn get_ptr_a<'a>(&'a self, ptr: *mut ()) -> &'a A
Extracts the immutable reference from the saved pointer and storage. Read more
unsafe fn get_ptr_b<'a>(&'a self, ptr: *mut ()) -> &'a B
See get_ptr_a.
unsafe fn get_mut_a<'a>(&'a mut self, ptr: *mut ()) -> &'a mut A
Extracts the mutable reference from the saved pointer and storage. Read more
unsafe fn get_mut_b<'a>(&'a mut self, ptr: *mut ()) -> &'a mut B
See get_mut_a.
unsafe fn deallocate_a(&mut self, ptr: *mut ())
Releases any allocations that would not be released by Stored being dropped. Read more
unsafe fn deallocate_b(&mut self, ptr: *mut ())
See deallocate_b.
unsafe fn deallocate_into_a(&mut self, ptr: *mut ()) -> A
Like deallocate_a(), but also return the owned value.
unsafe fn deallocate_into_b(&mut self, ptr: *mut ()) -> B
See deallocate_into_a.
fn is_internal_storage() -> bool
Returns whether this storage implementation ever causes the owned object to be stored internally to the Supercow. Read more