pub struct MutateCallbacks<State, Link, Marker, Policy = DefaultMutContextPolicy> { /* private fields */ }Expand description
A reusable typed-dispatch or callback mutator with shared user state.
Implementations§
Source§impl<State, Link, Marker> MutateCallbacks<State, Link, Marker>where
Link: MutateChainLink<State, Marker>,
impl<State, Link, Marker> MutateCallbacks<State, Link, Marker>where
Link: MutateChainLink<State, Marker>,
Source§impl<State, Link, Marker, Policy> MutateCallbacks<State, Link, Marker, Policy>
impl<State, Link, Marker, Policy> MutateCallbacks<State, Link, Marker, Policy>
Sourcepub fn with_policy<P: MutContextPolicy<State>>(
self,
policy: P,
) -> MutateCallbacks<State, Link, Marker, P>
pub fn with_policy<P: MutContextPolicy<State>>( self, policy: P, ) -> MutateCallbacks<State, Link, Marker, P>
Customize default descent while sharing the callback state.
Sourcepub fn state_mut(&mut self) -> &mut State
pub fn state_mut(&mut self) -> &mut State
Mutable access to callback state outside an active recursive call.
Sourcepub fn into_state(self) -> State
pub fn into_state(self) -> State
Consume the mutator and return its state.
Trait Implementations§
Source§impl<State, Link, Marker, Policy> StructuralMutator for MutateCallbacks<State, Link, Marker, Policy>where
Policy: MutContextPolicy<State>,
Link: MutateChainLink<State, Marker>,
impl<State, Link, Marker, Policy> StructuralMutator for MutateCallbacks<State, Link, Marker, Policy>where
Policy: MutContextPolicy<State>,
Link: MutateChainLink<State, Marker>,
Source§fn dispatch_mutate(
&mut self,
value: &StructuralView,
def_region_kind: DefRegionKind,
) -> Result<Any>
fn dispatch_mutate( &mut self, value: &StructuralView, def_region_kind: DefRegionKind, ) -> Result<Any>
Dispatch one borrowed value without modifying its source storage. Read more
Source§fn dispatch_maybe_inplace_mutate(
&mut self,
value: InplaceValue<'_>,
def_region_kind: DefRegionKind,
) -> Result<Any>
fn dispatch_maybe_inplace_mutate( &mut self, value: InplaceValue<'_>, def_region_kind: DefRegionKind, ) -> Result<Any>
Dispatch one value for which the engine permits an in-place attempt. Read more
Source§fn mutate<T>(
&mut self,
value: &T,
def_region_kind: DefRegionKind,
) -> Result<Any>
fn mutate<T>( &mut self, value: &T, def_region_kind: DefRegionKind, ) -> Result<Any>
Re-enter this mutator for a borrowed value. The value and all of its
descendants use the non-in-place path.
Source§fn maybe_inplace_mutate<T>(
&mut self,
value: T,
def_region_kind: DefRegionKind,
) -> Result<Any>
fn maybe_inplace_mutate<T>( &mut self, value: T, def_region_kind: DefRegionKind, ) -> Result<Any>
Re-enter this mutator for an owned value, permitting reuse only when
the converted value remains uniquely owned.
Source§fn maybe_inplace_mutate_with_mode<T>(
&mut self,
value: T,
def_region_kind: DefRegionKind,
mode: InplaceMode,
) -> Result<Any>
fn maybe_inplace_mutate_with_mode<T>( &mut self, value: T, def_region_kind: DefRegionKind, mode: InplaceMode, ) -> Result<Any>
Re-enter for an owned value with an explicit region and in-place permission. Read more
Source§fn default_mutate<T>(
&mut self,
value: &T,
def_region_kind: DefRegionKind,
) -> Result<Any>
fn default_mutate<T>( &mut self, value: &T, def_region_kind: DefRegionKind, ) -> Result<Any>
Apply default non-in-place mutation to a borrowed typed value. Read more
Source§fn default_maybe_inplace_mutate(
&mut self,
value: InplaceValue<'_>,
def_region_kind: DefRegionKind,
) -> Result<Any>
fn default_maybe_inplace_mutate( &mut self, value: InplaceValue<'_>, def_region_kind: DefRegionKind, ) -> Result<Any>
Apply the default mutation under an engine-issued in-place capability. Read more
Source§fn default_maybe_inplace_mutate_with_mode(
&mut self,
value: InplaceValue<'_>,
def_region_kind: DefRegionKind,
mode: InplaceMode,
) -> Result<Any>
fn default_maybe_inplace_mutate_with_mode( &mut self, value: InplaceValue<'_>, def_region_kind: DefRegionKind, mode: InplaceMode, ) -> Result<Any>
Apply default mutation with a capability and an explicit permission. Read more
Source§fn mutate_result<T>(
&mut self,
value: &T,
kind: DefRegionKind,
) -> Result<UnchangedOr<Any>>
fn mutate_result<T>( &mut self, value: &T, kind: DefRegionKind, ) -> Result<UnchangedOr<Any>>
Re-enter this mutator for a borrowed value, preserving unchanged.
Source§fn default_mutate_result<T>(
&mut self,
value: &T,
kind: DefRegionKind,
) -> Result<UnchangedOr<Any>>
fn default_mutate_result<T>( &mut self, value: &T, kind: DefRegionKind, ) -> Result<UnchangedOr<Any>>
Default mutation of a borrowed typed value, preserving unchanged.
Source§fn default_maybe_inplace_mutate_result(
&mut self,
value: InplaceValue<'_>,
kind: DefRegionKind,
) -> Result<UnchangedOr<Any>>
fn default_maybe_inplace_mutate_result( &mut self, value: InplaceValue<'_>, kind: DefRegionKind, ) -> Result<UnchangedOr<Any>>
Default mutation under an engine-issued capability, preserving unchanged.
Source§fn default_maybe_inplace_mutate_with_mode_result(
&mut self,
value: InplaceValue<'_>,
kind: DefRegionKind,
mode: InplaceMode,
) -> Result<UnchangedOr<Any>>
fn default_maybe_inplace_mutate_with_mode_result( &mut self, value: InplaceValue<'_>, kind: DefRegionKind, mode: InplaceMode, ) -> Result<UnchangedOr<Any>>
Default mutation with a capability and permission, preserving unchanged. Read more
Source§fn var_remap_get(&mut self, var: &StructuralView) -> Result<Option<Any>>
fn var_remap_get(&mut self, var: &StructuralView) -> Result<Option<Any>>
Look up a FreeVar or DAG-node substitution from the active mutation.
Source§fn var_remap_set(
&mut self,
var: &StructuralView,
mutated_value: &Any,
) -> Result<()>
fn var_remap_set( &mut self, var: &StructuralView, mutated_value: &Any, ) -> Result<()>
Store a FreeVar or DAG-node substitution for the active mutation.
Auto Trait Implementations§
impl<State, Link, Marker, Policy = DefaultMutContextPolicy> !Send for MutateCallbacks<State, Link, Marker, Policy>
impl<State, Link, Marker, Policy = DefaultMutContextPolicy> !Sync for MutateCallbacks<State, Link, Marker, Policy>
impl<State, Link, Marker, Policy> Freeze for MutateCallbacks<State, Link, Marker, Policy>where
State: Freeze,
impl<State, Link, Marker, Policy> RefUnwindSafe for MutateCallbacks<State, Link, Marker, Policy>
impl<State, Link, Marker, Policy> Unpin for MutateCallbacks<State, Link, Marker, Policy>where
State: Unpin,
impl<State, Link, Marker, Policy> UnsafeUnpin for MutateCallbacks<State, Link, Marker, Policy>where
State: UnsafeUnpin,
impl<State, Link, Marker, Policy> UnwindSafe for MutateCallbacks<State, Link, Marker, Policy>
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