Struct supercow::ext::InlineStorage
[−]
[src]
pub struct InlineStorage<A, B>(_);
Causes the OWNED or SHARED value of a Supercow to be stored inline.
This makes allocation of owned Supercows much faster, at the expense of
making the Supercow itself much bigger (since it now must contain the
whole object).
Trait Implementations
impl<A: Clone, B: Clone> Clone for InlineStorage<A, B>[src]
fn clone(&self) -> InlineStorage<A, B>
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<A: Copy, B: Copy> Copy for InlineStorage<A, B>[src]
impl<A: Debug, B: Debug> Debug for InlineStorage<A, B>[src]
impl<A, B> Default for InlineStorage<A, B>[src]
impl<A, B> OwnedStorage<A, B> for InlineStorage<A, B>[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, _: *mut ()) -> &'a A
Extracts the immutable reference from the saved pointer and storage. Read more
unsafe fn get_ptr_b<'a>(&'a self, _: *mut ()) -> &'a B
See get_ptr_a.
unsafe fn get_mut_a<'a>(&'a mut self, _: *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, _: *mut ()) -> &'a mut B
See get_mut_a.
unsafe fn deallocate_a(&mut self, _: *mut ())
Releases any allocations that would not be released by Stored being dropped. Read more
unsafe fn deallocate_b(&mut self, _: *mut ())
See deallocate_b.
unsafe fn deallocate_into_a(&mut self, _: *mut ()) -> A
Like deallocate_a(), but also return the owned value.
unsafe fn deallocate_into_b(&mut self, _: *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