pub struct WalkWithContextPolicy<Walker, Policy> { /* private fields */ }Expand description
A walk dispatcher combined with a reusable default-recursion policy.
The dispatcher is also the state visible through the policy’s context. Use
#[dispatch(walk)] or implement WalkDispatch to define its callbacks.
Pass this value or a mutable reference to structural_walk.
Implementations§
Source§impl<Walker: WalkDispatch, Policy: ContextPolicy<Walker>> WalkWithContextPolicy<Walker, Policy>
impl<Walker: WalkDispatch, Policy: ContextPolicy<Walker>> WalkWithContextPolicy<Walker, Policy>
Sourcepub fn new(walker: Walker, policy: Policy) -> Self
pub fn new(walker: Walker, policy: Policy) -> Self
Combine a dispatcher and a default-recursion policy.
Sourcepub fn state_mut(&mut self) -> &mut Walker
pub fn state_mut(&mut self) -> &mut Walker
Mutably access the dispatcher outside an active walk.
Sourcepub fn into_state(self) -> Walker
pub fn into_state(self) -> Walker
Recover the dispatcher and its state.
Auto Trait Implementations§
impl<Walker, Policy> !Send for WalkWithContextPolicy<Walker, Policy>
impl<Walker, Policy> !Sync for WalkWithContextPolicy<Walker, Policy>
impl<Walker, Policy> Freeze for WalkWithContextPolicy<Walker, Policy>where
Walker: Freeze,
impl<Walker, Policy> RefUnwindSafe for WalkWithContextPolicy<Walker, Policy>where
Walker: RefUnwindSafe,
Policy: RefUnwindSafe,
impl<Walker, Policy> Unpin for WalkWithContextPolicy<Walker, Policy>where
Walker: Unpin,
impl<Walker, Policy> UnsafeUnpin for WalkWithContextPolicy<Walker, Policy>where
Walker: UnsafeUnpin,
impl<Walker, Policy> UnwindSafe for WalkWithContextPolicy<Walker, Policy>where
Walker: UnwindSafe,
Policy: RefUnwindSafe,
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