Skip to main content

MutateDispatch

Trait MutateDispatch 

Source
pub trait MutateDispatch: Sized {
    // Required method
    fn dispatch_mutate(
        &mut self,
        value: &MapValue,
        mutator: &mut Mutator,
    ) -> Option<MutateResult>;
}
Expand description

Ordered typed callback dispatch for structural_mutate.

None means no handler matched, so structural mutation applies its default behavior. A generated #[dispatch(mutate)] implementation tests mutate_* methods in source order and passes the same Mutator to the first match. The implementation owns its pass state and receives &mut self, while Mutator only controls recursion and the definition region.

Required Methods§

Source

fn dispatch_mutate( &mut self, value: &MapValue, mutator: &mut Mutator, ) -> Option<MutateResult>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§