pub struct MemoryGuard { /* private fields */ }Expand description
Guards memory blocks with a liveness lock, preventing a set of memory blocks 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 the memory blocks. This can be useful when executing unsafe logic, where there may not otherwise exist any Rust objects holding references to memory blocks in use (e.g. because the code operating on them 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