pub struct RecursionGuard { /* private fields */ }Expand description
RAII guard that increments the calling thread’s recursion depth on creation and decrements it on drop.
Implementations§
Source§impl RecursionGuard
impl RecursionGuard
Sourcepub fn enter() -> Result<Self, RecursionError>
pub fn enter() -> Result<Self, RecursionError>
Enters one level of recursion.
§Errors
Returns RecursionError::DepthExceeded if entering would exceed the configured
maximum; the depth counter is left unchanged in that case.
Trait Implementations§
Source§impl Debug for RecursionGuard
impl Debug for RecursionGuard
Source§impl Drop for RecursionGuard
impl Drop for RecursionGuard
Auto Trait Implementations§
impl Freeze for RecursionGuard
impl RefUnwindSafe for RecursionGuard
impl Send for RecursionGuard
impl Sync for RecursionGuard
impl Unpin for RecursionGuard
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more