pub struct LayoutDepthGuard { /* private fields */ }Expand description
Lightweight Copy-context passed through layout formatting contexts to track recursion budget.
Implementations§
Source§impl LayoutDepthGuard
impl LayoutDepthGuard
Sourcepub const fn with_max_depth(max_depth: usize) -> Self
pub const fn with_max_depth(max_depth: usize) -> Self
Constructs a guard with a custom maximum depth limit (e.g. for testing).
Sourcepub fn enter(&self) -> Option<Self>
pub fn enter(&self) -> Option<Self>
Advances the guard into a child node frame. Returns None if the depth budget is exhausted.
pub fn current_depth(&self) -> usize
pub fn max_depth(&self) -> usize
pub fn is_exhausted(&self) -> bool
Trait Implementations§
Source§impl Clone for LayoutDepthGuard
impl Clone for LayoutDepthGuard
impl Copy for LayoutDepthGuard
Source§impl Debug for LayoutDepthGuard
impl Debug for LayoutDepthGuard
impl Eq for LayoutDepthGuard
Source§impl PartialEq for LayoutDepthGuard
impl PartialEq for LayoutDepthGuard
impl StructuralPartialEq for LayoutDepthGuard
Auto Trait Implementations§
impl Forget for LayoutDepthGuard
impl Freeze for LayoutDepthGuard
impl Move for LayoutDepthGuard
impl RefUnwindSafe for LayoutDepthGuard
impl Send for LayoutDepthGuard
impl Sync for LayoutDepthGuard
impl Unpin for LayoutDepthGuard
impl UnsafeUnpin for LayoutDepthGuard
impl UnwindSafe for LayoutDepthGuard
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