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> Buffer for Owned<T, A>
impl<T, A: Allocator> Buffer 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 buffer_capacity(&self) -> usize
fn buffer_capacity(&self) -> usize
Returns how many bytes of buffer the value occupies.
If this value is 0, then the T is ZST (zero sized type).
Source§fn buffer_offset(&self) -> usize
fn buffer_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<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.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