[][src]Struct conch_runtime::env::Env

pub struct Env<A, IO, FD, L, V, EX, WD, N: Eq + Hash, ERR> { /* fields omitted */ }

A shell environment implementation which delegates work to other environment implementations.

Uses Rc internally. For a possible Send and Sync implementation, see atomic::Env.

Methods

impl<A, IO, FD, L, V, EX, WD, N, ERR> Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    N: Hash + Eq
[src]

pub fn with_config(cfg: EnvConfig<A, IO, FD, L, V, EX, WD, N, ERR>) -> Self where
    V: ExportedVariableEnvironment,
    V::VarName: From<String>,
    V::Var: Borrow<String> + From<String>, 
[src]

Creates an environment using the provided configuration of subcomponents.

See EnvConfig for the kinds of overrides possible. DefaultEnvConfig comes with provided implementations to get you up and running.

General recommendations:

  • The result of evaluating a shell word will often be copied and reused in many different places. It's strongly recommened that Rc or Arc wrappers (e.g. Rc<String>) be used to minimize having to reallocate and copy the same data.
  • Whatever type represents a shell function body needs to be cloned to get around borrow restrictions and potential recursive executions and (re-)definitions. Since this type is probably an AST (which may be arbitrarily large), Rc and Arc are your friends.

Trait Implementations

impl<A, IO, FD, L, V, EX, WD, N, ERR> ArgumentsEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    A: ArgumentsEnvironment,
    A::Arg: Clone,
    N: Hash + Eq
[src]

type Arg = A::Arg

The type of arguments this environment holds.

impl<A, IO, FD, L, V, EX, WD, N, ERR> SetArgumentsEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    A: SetArgumentsEnvironment,
    N: Hash + Eq
[src]

type Args = A::Args

A collection of arguments to set.

impl<A, IO, FD, L, V, EX, WD, N, ERR> ShiftArgumentsEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    A: ShiftArgumentsEnvironment,
    N: Hash + Eq
[src]

impl<A, IO, FD, L, V, EX, WD, N, ERR> AsyncIoEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    IO: AsyncIoEnvironment,
    N: Hash + Eq
[src]

type Read = IO::Read

An async/futures-aware Read adapter around a FileDesc.

type WriteAll = IO::WriteAll

An future that represents writing data into a FileDesc.

impl<A, IO, FD, L, V, EX, WD, N, ERR> WorkingDirectoryEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    N: Hash + Eq,
    WD: WorkingDirectoryEnvironment
[src]

impl<A, IO, FD, L, V, EX, WD, N, ERR> ChangeWorkingDirectoryEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    N: Hash + Eq,
    WD: ChangeWorkingDirectoryEnvironment
[src]

impl<A, IO, FD, L, V, EX, WD, N, ERR> ExecutableEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    V: UnsetVariableEnvironment,
    N: Hash + Eq,
    EX: ExecutableEnvironment
[src]

type Future = EX::Future

A future which will resolve to the executable's exit status.

impl<A, IO, FD, L, V, EX, WD, N, ERR> FileDescEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    FD: FileDescEnvironment,
    N: Hash + Eq
[src]

type FileHandle = FD::FileHandle

A file handle (or wrapper) to associate with shell file descriptors.

impl<A, IO, FD, L, V, EX, WD, N, ERR> FunctionEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    N: Hash + Eq + Clone
[src]

type FnName = N

The name to be associated with a function.

type Fn = Rc<dyn SpawnBoxed<Self, Error = ERR>>

The type of the function.

impl<A, IO, FD, L, V, EX, WD, N, ERR> UnsetFunctionEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    N: Hash + Eq + Clone
[src]

impl<A, IO, FD, L, V, EX, WD, N, ERR> LastStatusEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    L: LastStatusEnvironment,
    N: Hash + Eq
[src]

impl<A, IO, FD, L, V, EX, WD, N, ERR> VariableEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    V: VariableEnvironment,
    N: Hash + Eq
[src]

type VarName = V::VarName

The type of the name this environment associates for a variable.

type Var = V::Var

The type of variables this environment holds.

impl<A, IO, FD, L, V, EX, WD, N, ERR> ExportedVariableEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    V: ExportedVariableEnvironment,
    N: Hash + Eq
[src]

impl<A, IO, FD, L, V, EX, WD, N, ERR> UnsetVariableEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    V: UnsetVariableEnvironment,
    N: Hash + Eq
[src]

impl<A, IO, FD, L, V, EX, WD, N, ERR> IsInteractiveEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    N: Hash + Eq
[src]

impl<A, IO, FD, L, V, EX, WD, N, ERR> ReportErrorEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    A: ArgumentsEnvironment,
    A::Arg: Display,
    FD: FileDescEnvironment,
    FD::FileHandle: Borrow<FileDesc>,
    N: Hash + Eq
[src]

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
[src]

impl<A, IO, FD, L, V, EX, WD, N, ERR> Clone for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    A: Clone,
    FD: Clone,
    L: Clone,
    V: Clone,
    N: Hash + Eq,
    IO: Clone,
    EX: Clone,
    WD: Clone
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<A, IO, FD, L, V, EX, WD, N, ERR> From<EnvConfig<A, IO, FD, L, V, EX, WD, N, ERR>> for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    N: Hash + Eq,
    V: ExportedVariableEnvironment,
    V::VarName: From<String>,
    V::Var: Borrow<String> + From<String>, 
[src]

impl<A, IO, FD, L, V, EX, WD, N, ERR> Debug for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
    A: Debug,
    FD: Debug,
    L: Debug,
    V: Debug,
    N: Hash + Eq + Ord + Debug,
    IO: Debug,
    EX: Debug,
    WD: Debug
[src]

Auto Trait Implementations

impl<A, IO, FD, L, V, EX, WD, N, ERR> !Send for Env<A, IO, FD, L, V, EX, WD, N, ERR>

impl<A, IO, FD, L, V, EX, WD, N, ERR> !Sync for Env<A, IO, FD, L, V, EX, WD, N, ERR>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T