pub struct Mutator { /* private fields */ }Expand description
Recursion control passed to a typed #[dispatch(mutate)] handler.
The dispatch object owns all pass state. Recursive operations take that
object explicitly so Rust can safely reborrow the same &mut self for the
child call. Node access comes only from the callback argument; default
recursion takes that value explicitly.
Implementations§
Source§impl Mutator
impl Mutator
Sourcepub fn inplace_mode(&self) -> InplaceMode
pub fn inplace_mode(&self) -> InplaceMode
Engine-established permission for this callback’s current value.
This is not authority to modify a borrow: default in-place descent also
requires consuming a MutateValue.
Sourcepub fn def_region_kind(&self) -> DefRegionKind
pub fn def_region_kind(&self) -> DefRegionKind
Definition-region state active at the callback’s current value.
Sourcepub fn mutate<D, T>(&mut self, dispatch: &mut D, value: &T) -> Result<Any>
pub fn mutate<D, T>(&mut self, dispatch: &mut D, value: &T) -> Result<Any>
Mutate a borrowed child through the same typed dispatch object.
Sourcepub fn mutate_with<D, T>(
&mut self,
dispatch: &mut D,
value: &T,
def_region_kind: DefRegionKind,
) -> Result<Any>
pub fn mutate_with<D, T>( &mut self, dispatch: &mut D, value: &T, def_region_kind: DefRegionKind, ) -> Result<Any>
Mutate a borrowed child under an explicit definition-region state.
Sourcepub fn maybe_inplace_mutate<D, T>(
&mut self,
dispatch: &mut D,
value: T,
) -> Result<Any>
pub fn maybe_inplace_mutate<D, T>( &mut self, dispatch: &mut D, value: T, ) -> Result<Any>
Mutate an owned child and permit reuse when it remains uniquely owned.
Sourcepub fn maybe_inplace_mutate_with<D, T>(
&mut self,
dispatch: &mut D,
value: T,
def_region_kind: DefRegionKind,
) -> Result<Any>
pub fn maybe_inplace_mutate_with<D, T>( &mut self, dispatch: &mut D, value: T, def_region_kind: DefRegionKind, ) -> Result<Any>
Mutate an owned child under an explicit definition-region state.
Sourcepub fn maybe_inplace_mutate_with_mode<D, T>(
&mut self,
dispatch: &mut D,
value: T,
def_region_kind: DefRegionKind,
mode: InplaceMode,
) -> Result<Any>
pub fn maybe_inplace_mutate_with_mode<D, T>( &mut self, dispatch: &mut D, value: T, def_region_kind: DefRegionKind, mode: InplaceMode, ) -> Result<Any>
Mutate an owned child under an explicit region and in-place permission.
Disallow keeps this input on the copy path even when uniquely owned.
Sourcepub fn default_mutate<D, T>(
&mut self,
dispatch: &mut D,
value: &T,
) -> Result<Any>
pub fn default_mutate<D, T>( &mut self, dispatch: &mut D, value: &T, ) -> Result<Any>
Apply default copy-only mutation to an explicitly borrowed value.
Sourcepub fn mutate_result<D, T>(
&mut self,
dispatch: &mut D,
value: &T,
) -> Result<UnchangedOr<Any>>
pub fn mutate_result<D, T>( &mut self, dispatch: &mut D, value: &T, ) -> Result<UnchangedOr<Any>>
Mutate a borrowed child while preserving an unchanged result.
Sourcepub fn mutate_with_result<D, T>(
&mut self,
dispatch: &mut D,
value: &T,
kind: DefRegionKind,
) -> Result<UnchangedOr<Any>>
pub fn mutate_with_result<D, T>( &mut self, dispatch: &mut D, value: &T, kind: DefRegionKind, ) -> Result<UnchangedOr<Any>>
Mutate a borrowed child under an explicit region, preserving unchanged.
Sourcepub fn default_mutate_result<D, T>(
&mut self,
dispatch: &mut D,
value: &T,
) -> Result<UnchangedOr<Any>>
pub fn default_mutate_result<D, T>( &mut self, dispatch: &mut D, value: &T, ) -> Result<UnchangedOr<Any>>
Apply default mutation without materializing an unchanged original.
Sourcepub fn default_maybe_inplace_mutate<D: MutateDispatch, T>(
&mut self,
dispatch: &mut D,
value: MutateValue<'_, T>,
) -> Result<Any>
pub fn default_maybe_inplace_mutate<D: MutateDispatch, T>( &mut self, dispatch: &mut D, value: MutateValue<'_, T>, ) -> Result<Any>
Consume the handle for default descent with its existing permission.
Sourcepub fn default_maybe_inplace_mutate_result<D: MutateDispatch, T>(
&mut self,
dispatch: &mut D,
value: MutateValue<'_, T>,
) -> Result<UnchangedOr<Any>>
pub fn default_maybe_inplace_mutate_result<D: MutateDispatch, T>( &mut self, dispatch: &mut D, value: MutateValue<'_, T>, ) -> Result<UnchangedOr<Any>>
Consume the handle for default descent, preserving permission and Unchanged.
Sourcepub fn default_mutate_with_mode<D: MutateDispatch, T>(
&mut self,
dispatch: &mut D,
value: MutateValue<'_, T>,
mode: InplaceMode,
) -> Result<Any>
pub fn default_mutate_with_mode<D: MutateDispatch, T>( &mut self, dispatch: &mut D, value: MutateValue<'_, T>, mode: InplaceMode, ) -> Result<Any>
Continue default mutation after relinquishing the callback value’s borrows.
The requested mode can restrict, but cannot upgrade, the engine-issued permission. Retained owning aliases force copying.
Sourcepub fn default_mutate_with_mode_result<D: MutateDispatch, T>(
&mut self,
dispatch: &mut D,
value: MutateValue<'_, T>,
mode: InplaceMode,
) -> Result<UnchangedOr<Any>>
pub fn default_mutate_with_mode_result<D: MutateDispatch, T>( &mut self, dispatch: &mut D, value: MutateValue<'_, T>, mode: InplaceMode, ) -> Result<UnchangedOr<Any>>
Consume the callback value for default descent, preserving Unchanged.
Sourcepub fn var_remap_get<D: MutateDispatch>(
&mut self,
dispatch: &mut D,
var: &StructuralView,
) -> Result<Option<Any>>
pub fn var_remap_get<D: MutateDispatch>( &mut self, dispatch: &mut D, var: &StructuralView, ) -> Result<Option<Any>>
Look up an invocation-local identity substitution.
Sourcepub fn var_remap_set<D: MutateDispatch>(
&mut self,
dispatch: &mut D,
var: &StructuralView,
mutated_value: &Any,
) -> Result<()>
pub fn var_remap_set<D: MutateDispatch>( &mut self, dispatch: &mut D, var: &StructuralView, mutated_value: &Any, ) -> Result<()>
Store an invocation-local identity substitution.