pub struct MemoryGuard { /* private fields */ }Expand description
Prevents memory capacity from being released while the guard is alive.
Call BytesView::extend_lifetime() or BytesBuf::extend_lifetime() to obtain
an instance.
The memory may be used for any otherwise legal purpose; all this guard does is act as a shadow reference to some memory capacity.
This can be useful when executing unsafe logic, where there may not otherwise exist any Rust objects holding references to memory capacity in use (e.g. because the code operating on the capacity is not even Rust code).
Trait Implementations§
Source§impl Debug for MemoryGuard
impl Debug for MemoryGuard
Auto Trait Implementations§
impl Freeze for MemoryGuard
impl RefUnwindSafe for MemoryGuard
impl Send for MemoryGuard
impl Sync for MemoryGuard
impl Unpin for MemoryGuard
impl UnwindSafe for MemoryGuard
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