Struct rarena_allocator::Owned
source · pub struct Owned<T, A: Allocator> { /* private fields */ }Expand description
An owned to a value T in the ARENA.
Implementations§
source§impl<T, A: Allocator> Owned<T, A>
impl<T, A: Allocator> Owned<T, A>
sourcepub fn as_mut_ptr(&mut self) -> NonNull<T>
pub fn as_mut_ptr(&mut self) -> NonNull<T>
Returns the pointer to the T, the pointer may not be initialized.
If the pointer is not initialized, then NonNull::dangling() is returned.
Trait Implementations§
source§impl<T, A: Allocator> Memory for Owned<T, A>
impl<T, A: Allocator> Memory for Owned<T, A>
source§fn capacity(&self) -> usize
fn capacity(&self) -> usize
Returns how many bytes of T occupies.
If this value is 0, then the T is ZST (zero sized type).
source§fn offset(&self) -> usize
fn offset(&self) -> usize
Returns the offset of T to the pointer of the ARENA.
If this value is 0, then the T is ZST (zero sized type).
source§fn memory_capacity(&self) -> usize
fn memory_capacity(&self) -> usize
Returns how many bytes of memory the value occupies.
If this value is 0, then the T is ZST (zero sized type).
source§fn memory_offset(&self) -> usize
fn memory_offset(&self) -> usize
Returns the offset to the pointer of the ARENA.
If this value is 0, then the T is ZST (zero sized type).
source§fn flush_async(&self) -> Result<()>
Available on crate feature memmap and non-target_family="wasm" only.
fn flush_async(&self) -> Result<()>
memmap and non-target_family="wasm" only.Asynchronously flush the buffer to the disk.
impl<A: Allocator + Send, T> Send for Owned<T, A>
impl<A: Allocator + Sync, T> Sync for Owned<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for Owned<T, A>
impl<T, A> RefUnwindSafe for Owned<T, A>where
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, A> Unpin for Owned<T, A>
impl<T, A> UnwindSafe for Owned<T, A>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more