tvm_ffi::extra::structural_mutate

Struct StructuralMutatorView

Source
pub struct StructuralMutatorView<'a, D> { /* private fields */ }
Expand description

Recursive mutation and default descent for a dispatcher.

Pass the handler’s self to mutation methods to recurse with the same state. Full mutation re-enters dispatch; default mutation runs Base descent. Both preserve UnchangedOr; resolve it only when an owning value is needed.

Implementations§

Source§

impl<D> StructuralMutatorView<'_, D>

Source

pub fn def_region_kind(&self) -> DefRegionKind

Source

pub fn with_def_region_kind<R>( &mut self, kind: DefRegionKind, callback: impl FnOnce(&mut StructuralMutatorView<'_, D>) -> R, ) -> R

Run recursive operations under a scoped definition region. An enclosing Pattern wins; the original region is restored on all exits.

Source

pub fn mutate<'input, T>( &mut self, dispatch: &mut D, value: impl Into<MutationView<'input, T>>, ) -> Result<UnchangedOr<Any>>

Re-enter dispatch with the capability’s carried permission.

Source

pub fn default_mutate<'input, T>( &mut self, dispatch: &mut D, value: impl Into<MutationView<'input, T>>, ) -> Result<UnchangedOr<Any>>

Run Base default descent with the capability’s carried permission.

Source

pub fn var_remap_get( &mut self, dispatch: &mut D, var: AnyView<'_>, ) -> Result<Option<Any>>

Source

pub fn var_remap_set( &mut self, dispatch: &mut D, var: AnyView<'_>, value: &Any, ) -> Result<()>

Auto Trait Implementations§

§

impl<'a, D> Freeze for StructuralMutatorView<'a, D>

§

impl<'a, D> RefUnwindSafe for StructuralMutatorView<'a, D>

§

impl<'a, D> !Send for StructuralMutatorView<'a, D>

§

impl<'a, D> !Sync for StructuralMutatorView<'a, D>

§

impl<'a, D> Unpin for StructuralMutatorView<'a, D>

§

impl<'a, D> !UnwindSafe for StructuralMutatorView<'a, D>

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.