Trait conch_runtime::env::SubEnvironment
[−]
[src]
pub trait SubEnvironment: Sized { fn sub_env(&self) -> Self; }
An interface for all environments that can produce another environment, identical to itself, but any changes applied to the sub environment will not be reflected on the parent.
Although this trait is very similar to the Clone
trait, it is beneficial
for subenvironments to be created as cheaply as possible (in the event that
no changes are made to the subenvironment, there is no need for a deep clone),
without relying on default Clone
implementations or semantics.
It is strongly encouraged for implementors to utilize clone-on-write smart
pointers or other mechanisms (e.g. Rc
) to ensure creating and mutating sub
environments is as cheap as possible.
Required Methods
fn sub_env(&self) -> Self
Create a new sub-environment, which starts out idential to its parent, but any changes on the new environment will not be reflected on the parent.
Implementors
impl<T> SubEnvironment for ArgsEnv<T>
impl<T> SubEnvironment for AtomicArgsEnv<T>
impl SubEnvironment for PlatformSpecificAsyncIoEnv
impl SubEnvironment for ThreadPoolAsyncIoEnv
impl SubEnvironment for VirtualWorkingDirEnv
impl SubEnvironment for AtomicVirtualWorkingDirEnv
impl<A, IO, FD, L, V, EX, WD, N, ERR> SubEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
A: SubEnvironment,
FD: SubEnvironment,
L: SubEnvironment,
V: SubEnvironment,
N: Hash + Eq,
IO: SubEnvironment,
EX: SubEnvironment,
WD: SubEnvironment,impl<A, IO, FD, L, V, EX, WD, N, ERR> SubEnvironment for AtomicEnv<A, IO, FD, L, V, EX, WD, N, ERR> where
A: SubEnvironment,
FD: SubEnvironment,
L: SubEnvironment,
V: SubEnvironment,
N: Hash + Eq,
IO: SubEnvironment,
EX: SubEnvironment,
WD: SubEnvironment,impl SubEnvironment for ExecEnv
impl<T> SubEnvironment for FileDescEnv<T>
impl<T> SubEnvironment for AtomicFileDescEnv<T>
impl<N: Hash + Eq, F> SubEnvironment for FnEnv<N, F>
impl<N: Hash + Eq, F> SubEnvironment for AtomicFnEnv<N, F>
impl SubEnvironment for LastStatusEnv
impl<N: Eq + Hash, V> SubEnvironment for VarEnv<N, V>
impl<N: Eq + Hash, V> SubEnvironment for AtomicVarEnv<N, V>
impl SubEnvironment for EventedAsyncIoEnv