Struct mz_ore::stack::RecursionGuard
source · pub struct RecursionGuard {
depth: RefCell<usize>,
limit: usize,
}
Available on crate feature
stack
only.Expand description
Tracks recursion depth.
See the CheckedRecursion
trait for usage instructions.
Fields§
§depth: RefCell<usize>
§limit: usize
Implementations§
source§impl RecursionGuard
impl RecursionGuard
sourcepub fn with_limit(limit: usize) -> RecursionGuard
pub fn with_limit(limit: usize) -> RecursionGuard
Constructs a new recursion guard with the specified recursion limit.
fn descend(&self) -> Result<(), RecursionLimitError>
fn ascend(&self)
Trait Implementations§
source§impl CheckedRecursion for RecursionGuard
impl CheckedRecursion for RecursionGuard
source§fn recursion_guard(&self) -> &RecursionGuard
fn recursion_guard(&self) -> &RecursionGuard
Extracts a reference to the recursion guard embedded within the type.
source§fn checked_recur<F, T, E>(&self, f: F) -> Result<T, E>
fn checked_recur<F, T, E>(&self, f: F) -> Result<T, E>
Checks whether it is safe to recur and calls
f
if so. Read moresource§fn checked_recur_mut<F, T, E>(&mut self, f: F) -> Result<T, E>
fn checked_recur_mut<F, T, E>(&mut self, f: F) -> Result<T, E>
Like
CheckedRecursion::checked_recur
, but operates on a mutable
reference to Self
.source§impl Clone for RecursionGuard
impl Clone for RecursionGuard
source§fn clone(&self) -> RecursionGuard
fn clone(&self) -> RecursionGuard
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RecursionGuard
impl Debug for RecursionGuard
source§impl Default for RecursionGuard
impl Default for RecursionGuard
source§fn default() -> RecursionGuard
fn default() -> RecursionGuard
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for RecursionGuard
impl !RefUnwindSafe for RecursionGuard
impl Send for RecursionGuard
impl !Sync for RecursionGuard
impl Unpin for RecursionGuard
impl UnwindSafe for RecursionGuard
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request