pub struct RefMut<'a, T, A: Allocator> { /* private fields */ }Expand description
A mutable reference to a value T in the ARENA.
Implementations§
Source§impl<'a, T, A: Allocator> RefMut<'a, T, A>
impl<'a, T, A: Allocator> RefMut<'a, 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 RefMut<'_, T, A>
impl<T, A: Allocator> Buffer for RefMut<'_, T, A>
Source§unsafe fn detach(&mut self)
unsafe fn detach(&mut self)
Detach the value from the ARENA, which means when the value is dropped, the underlying memory will not be collected for futhur allocation.
§Safety
- If
Tis not inlined (core::mem::needs_drop::<T>()returnstrue), then users should take care of dropping the value by themselves.
Source§fn buffer_capacity(&self) -> usize
fn buffer_capacity(&self) -> usize
Returns how many bytes of the whole buffer occupies.
Source§fn buffer_offset(&self) -> usize
fn buffer_offset(&self) -> usize
Returns the offset to the pointer of the allocator.
Source§fn flush(&self) -> Result<()>
fn flush(&self) -> Result<()>
Available on crate feature
memmap and non-target_family="wasm" only.Flush the buffer to the disk.
Source§fn flush_async(&self) -> Result<()>
fn flush_async(&self) -> Result<()>
Available on crate feature
memmap and non-target_family="wasm" only.Asynchronously flush the buffer to the disk.
Auto Trait Implementations§
impl<'a, T, A> Freeze for RefMut<'a, T, A>where
T: Freeze,
impl<'a, T, A> RefUnwindSafe for RefMut<'a, T, A>where
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T, A> !Send for RefMut<'a, T, A>
impl<'a, T, A> !Sync for RefMut<'a, T, A>
impl<'a, T, A> Unpin for RefMut<'a, T, A>where
T: Unpin,
impl<'a, T, A> UnwindSafe for RefMut<'a, 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