pub trait MutContextPolicy<State> {
// Required method
fn default_mutate(
&self,
value: MutateValue<'_>,
ctx: &mut MutateContext<'_, State>,
) -> Result<UnchangedOr<Any>>;
}Expand description
Default-recursion policy for MutateCallbacks::with_policy and MapWithContextPolicy.
ctx.default_maybe_inplace_mutate_result(value) continues to the next policy,
then hooks or reflected fields; children re-enter callback dispatch.
Policies share callback state and compose as (outer, inner).
Restore user state before returning, including on errors; use
MutateContext::with_def_region_kind for scoped definition regions.
Required Methods§
Sourcefn default_mutate(
&self,
value: MutateValue<'_>,
ctx: &mut MutateContext<'_, State>,
) -> Result<UnchangedOr<Any>>
fn default_mutate( &self, value: MutateValue<'_>, ctx: &mut MutateContext<'_, State>, ) -> Result<UnchangedOr<Any>>
Customize default descent, preserving the input permission and result marker.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".