Skip to main content

MutatingEnv

Trait MutatingEnv 

Source
pub trait MutatingEnv: Send + Sync {
    // Required methods
    fn as_env(&self) -> &dyn ExecutionEnv;
    fn mutation_registry(&self) -> &MutationQueueRegistry;
}
Expand description

Accessor used by with_file_mutation_queue to reach the env’s registry AND its ExecutionEnv methods. Concrete env impls (OsExecutionEnv, InMemoryExecutionEnv) implement this; the write/edit tools hold Arc<dyn MutatingEnv>.

The as_env indirection avoids needing trait-upcasting (dyn MutatingEnv → dyn ExecutionEnv, unstable before Rust 1.86); our min rust-version is 1.78, so we expose the env explicitly.

Required Methods§

Source

fn as_env(&self) -> &dyn ExecutionEnv

The underlying ExecutionEnv (for FileSystem/Shell calls).

Source

fn mutation_registry(&self) -> &MutationQueueRegistry

The registry holding per-canonical-path mutexes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§