pub struct FrameGuard<'a> { /* private fields */ }Expand description
A guard that represents a frame scope.
When dropped, the frame arena is reset to its state when the guard was created. This is useful for sub-frame temporary allocations.
§Example
use framealloc::SmartAlloc;
let alloc = SmartAlloc::with_defaults();
{
let _scope = alloc.frame_scope();
let temp = alloc.frame_alloc::<[u8; 1024]>();
// temp is valid here
} // temp is invalidated hereImplementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for FrameGuard<'a>
impl<'a> !RefUnwindSafe for FrameGuard<'a>
impl<'a> Send for FrameGuard<'a>
impl<'a> Sync for FrameGuard<'a>
impl<'a> Unpin for FrameGuard<'a>
impl<'a> !UnwindSafe for FrameGuard<'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