pub struct MapWithContextPolicy<Mapper, Policy> { /* private fields */ }Expand description
A MapDispatch with a MutContextPolicy, sharing the dispatcher’s state.
Pass this value or a mutable reference to structural_map. Each node’s
map callback runs outside its policy scope; its children run inside.
This mapper cannot be a callback tuple member or another wrapper’s dispatcher.
Compose policies as (outer, inner) within one wrapper.
Implementations§
Source§impl<Mapper: MapDispatch, Policy: MutContextPolicy<Mapper>> MapWithContextPolicy<Mapper, Policy>
impl<Mapper: MapDispatch, Policy: MutContextPolicy<Mapper>> MapWithContextPolicy<Mapper, Policy>
Sourcepub fn new(mapper: Mapper, policy: Policy) -> Self
pub fn new(mapper: Mapper, policy: Policy) -> Self
Combine a dispatcher and a default-recursion policy.
Sourcepub fn state_mut(&mut self) -> &mut Mapper
pub fn state_mut(&mut self) -> &mut Mapper
Mutably access the dispatcher outside recursive calls.
Sourcepub fn into_state(self) -> Mapper
pub fn into_state(self) -> Mapper
Recover the dispatcher and its state.
Auto Trait Implementations§
impl<Mapper, Policy> !Send for MapWithContextPolicy<Mapper, Policy>
impl<Mapper, Policy> !Sync for MapWithContextPolicy<Mapper, Policy>
impl<Mapper, Policy> Freeze for MapWithContextPolicy<Mapper, Policy>where
Mapper: Freeze,
impl<Mapper, Policy> RefUnwindSafe for MapWithContextPolicy<Mapper, Policy>where
Mapper: RefUnwindSafe,
Policy: RefUnwindSafe,
impl<Mapper, Policy> Unpin for MapWithContextPolicy<Mapper, Policy>where
Mapper: Unpin,
impl<Mapper, Policy> UnsafeUnpin for MapWithContextPolicy<Mapper, Policy>where
Mapper: UnsafeUnpin,
impl<Mapper, Policy> UnwindSafe for MapWithContextPolicy<Mapper, Policy>where
Mapper: 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