pub struct StackLimit { /* private fields */ }Expand description
A bound on the call stack: at most max bytes deeper than the position of the stack
where it was taken (StackLimit::from_here). Stacks grow downwards on every
supported target, the WebAssembly shadow stack included; the distance is taken
either way.
Implementations§
Source§impl StackLimit
impl StackLimit
Sourcepub fn from_here(max: u32) -> Self
pub fn from_here(max: u32) -> Self
A bound of max bytes below the current position of the stack.
Sourcepub fn used(self) -> usize
pub fn used(self) -> usize
The stack used between the position where the bound was taken and here.
Sourcepub fn check(self) -> Result<(), LimitExceeded>
pub fn check(self) -> Result<(), LimitExceeded>
LimitExceeded::Stack when the stack used is beyond the bound.
§Errors
The stack used is beyond the bound.
Trait Implementations§
Source§impl Clone for StackLimit
impl Clone for StackLimit
impl Copy for StackLimit
Source§impl Debug for StackLimit
impl Debug for StackLimit
impl Eq for StackLimit
Source§impl PartialEq for StackLimit
impl PartialEq for StackLimit
impl StructuralPartialEq for StackLimit
Auto Trait Implementations§
impl Forget for StackLimit
impl Freeze for StackLimit
impl RefUnwindSafe for StackLimit
impl Send for StackLimit
impl Sync for StackLimit
impl Unpin for StackLimit
impl UnsafeUnpin for StackLimit
impl UnwindSafe for StackLimit
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