Trait conch_runtime::env::ArgumentsEnvironment [−][src]
pub trait ArgumentsEnvironment { type Arg: Clone; fn name(&self) -> &Self::Arg; fn arg(&self, idx: usize) -> Option<&Self::Arg>; fn args_len(&self) -> usize; fn args(&self) -> Cow<[Self::Arg]>; }
An interface for getting shell and function arguments.
Associated Types
Required Methods
fn name(&self) -> &Self::Arg
Get the name of the shell.
fn arg(&self, idx: usize) -> Option<&Self::Arg>
Get an argument at any index. Arguments are 1-indexed since the shell variable $0
refers to the shell's name. Thus the first real argument starts at index 1.
fn args_len(&self) -> usize
Get the number of current arguments, NOT including the shell name.
fn args(&self) -> Cow<[Self::Arg]>
Get all current arguments as a possibly owned slice.
Implementations on Foreign Types
impl<'a, T: ?Sized + ArgumentsEnvironment> ArgumentsEnvironment for &'a T
[src]
impl<'a, T: ?Sized + ArgumentsEnvironment> ArgumentsEnvironment for &'a T
impl<'a, T: ?Sized + ArgumentsEnvironment> ArgumentsEnvironment for &'a mut T
[src]
impl<'a, T: ?Sized + ArgumentsEnvironment> ArgumentsEnvironment for &'a mut T
Implementors
impl<T: Clone> ArgumentsEnvironment for ArgsEnv<T> type Arg = T;
impl<T: Clone> ArgumentsEnvironment for AtomicArgsEnv<T> type Arg = T;
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, type Arg = A::Arg;impl<A, IO, FD, L, V, EX, WD, N, ERR> ArgumentsEnvironment for AtomicEnv<A, IO, FD, L, V, EX, WD, N, ERR> where
A: ArgumentsEnvironment,
A::Arg: Clone,
N: Hash + Eq, type Arg = A::Arg;