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§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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§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