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

The type of arguments this environment holds.

Required Methods

Get the name of the shell.

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.

Get the number of current arguments, NOT including the shell name.

Get all current arguments as a possibly owned slice.

Implementations on Foreign Types

impl<'a, T: ?Sized + ArgumentsEnvironment> ArgumentsEnvironment for &'a T
[src]

[src]

[src]

[src]

[src]

impl<'a, T: ?Sized + ArgumentsEnvironment> ArgumentsEnvironment for &'a mut T
[src]

[src]

[src]

[src]

[src]

Implementors