pub struct StackGuard<'thread> { /* private fields */ }Expand description
Implementations§
Source§impl<'thread> StackGuard<'thread>
impl<'thread> StackGuard<'thread>
Sourcepub unsafe fn new(thread: &'thread Thread) -> Self
pub unsafe fn new(thread: &'thread Thread) -> Self
Captures the thread’s current stack height.
§Safety
thread must remain a live VM thread for the guard’s lifetime. While
the guard is active, callers must not shrink the stack below the
captured height or otherwise invalidate that saved stack position.
pub const fn top(&self) -> i32
pub fn keep(&mut self, count: i32)
pub fn into_top(self) -> i32
pub fn dismiss(self)
Trait Implementations§
Source§impl Drop for StackGuard<'_>
impl Drop for StackGuard<'_>
Auto Trait Implementations§
impl<'thread> !RefUnwindSafe for StackGuard<'thread>
impl<'thread> !Send for StackGuard<'thread>
impl<'thread> !Sync for StackGuard<'thread>
impl<'thread> !UnwindSafe for StackGuard<'thread>
impl<'thread> Freeze for StackGuard<'thread>
impl<'thread> Unpin for StackGuard<'thread>
impl<'thread> UnsafeUnpin for StackGuard<'thread>
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