Skip to main content

MutateCallbacks

Struct MutateCallbacks 

Source
pub struct MutateCallbacks<State, Link, Marker> { /* 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>,

Source

pub fn new(state: State, callbacks: Link) -> Self

Construct a stateful callback mutator.

Source§

impl<State, Link, Marker> MutateCallbacks<State, Link, Marker>

Source

pub fn state(&self) -> &State

Shared access to the callback state.

Source

pub fn state_mut(&mut self) -> &mut State

Mutable access to callback state outside an active recursive call.

Source

pub fn into_state(self) -> State

Consume the mutator and return its state.

Trait Implementations§

Source§

impl<State, Link, Marker> StructuralMutator for MutateCallbacks<State, Link, Marker>
where Link: MutateChainLink<State, Marker>, Link::Strategy: MutateCallbackStrategy<State, Link, Marker>,

Source§

fn dispatch_mutate( &mut self, value: &MapValue, 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>

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>
where for<'x> AnyView<'x>: From<&'x T>,

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>
where T: Into<Any>,

Re-enter this mutator for an owned value, permitting reuse only when the converted value remains uniquely owned.
Source§

fn default_mutate( &mut self, value: &MapValue, def_region_kind: DefRegionKind, ) -> Result<Any>

Apply default non-in-place mutation to value’s children.
Source§

fn default_mutate_value<T>( &mut self, value: &T, def_region_kind: DefRegionKind, ) -> Result<Any>
where for<'x> AnyView<'x>: From<&'x T>,

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>

Apply the default mutation under an engine-issued in-place capability. Read more
Source§

fn mutate_result<T>( &mut self, value: &T, kind: DefRegionKind, ) -> Result<UnchangedOr<Any>>
where for<'x> AnyView<'x>: From<&'x T>,

Re-enter this mutator for a borrowed value, preserving unchanged.
Source§

fn default_mutate_result( &mut self, value: &MapValue, kind: DefRegionKind, ) -> Result<UnchangedOr<Any>>

Default non-in-place mutation with an unchanged-or-replacement result.
Source§

fn default_mutate_value_result<T>( &mut self, value: &T, kind: DefRegionKind, ) -> Result<UnchangedOr<Any>>
where for<'x> AnyView<'x>: From<&'x T>,

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>>

Default mutation under an engine-issued capability, preserving unchanged.
Source§

fn var_remap_get(&mut self, var: &MapValue) -> Result<Option<Any>>

Look up a FreeVar or DAG-node substitution from the active mutation.
Source§

fn var_remap_set(&mut self, var: &MapValue, mutated_value: &Any) -> Result<()>

Store a FreeVar or DAG-node substitution for the active mutation.

Auto Trait Implementations§

§

impl<State, Link, Marker> !Send for MutateCallbacks<State, Link, Marker>

§

impl<State, Link, Marker> !Sync for MutateCallbacks<State, Link, Marker>

§

impl<State, Link, Marker> Freeze for MutateCallbacks<State, Link, Marker>
where State: Freeze,

§

impl<State, Link, Marker> RefUnwindSafe for MutateCallbacks<State, Link, Marker>
where State: RefUnwindSafe, Link: RefUnwindSafe,

§

impl<State, Link, Marker> Unpin for MutateCallbacks<State, Link, Marker>
where State: Unpin,

§

impl<State, Link, Marker> UnsafeUnpin for MutateCallbacks<State, Link, Marker>
where State: UnsafeUnpin,

§

impl<State, Link, Marker> UnwindSafe for MutateCallbacks<State, Link, Marker>
where State: UnwindSafe, Link: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.