Skip to main content

Args

Trait Args 

Source
pub trait Args<C>: Sized {
    // Required methods
    fn new<'a, 'b>(c: &C, args: &mut ParsedArgs<'b>) -> Result<Self, ErrArgs>;
    fn desc_act() -> &'static str;
    fn add_paths<'a>(pfx: &Vec<Arg<'a>>, p: &mut Vec<Vec<Arg<'a>>>);
    fn add_usage(c: &C, r: &mut Vec<[String; 4]>);
    fn default(c: &C) -> Self;
    fn run(self, c: &C, r: Vec<&str>) -> Result<(), String>;

    // Provided methods
    fn next_impl<'a>(c: &C, args: &[Arg<'a>]) -> Result<(), ErrArgs> { ... }
    fn next<'a>(
        c: &C,
        s: &mut ParseCtx<'a>,
        args: &[Arg<'a>],
    ) -> Result<(), ErrArgs> { ... }
    fn usage(c: &C) -> String { ... }
    fn full_usage(c: &C, exec: &str, pfx: &[&str]) -> String { ... }
}

Required Methods§

Source

fn new<'a, 'b>(c: &C, args: &mut ParsedArgs<'b>) -> Result<Self, ErrArgs>

Source

fn desc_act() -> &'static str

Source

fn add_paths<'a>(pfx: &Vec<Arg<'a>>, p: &mut Vec<Vec<Arg<'a>>>)

Source

fn add_usage(c: &C, r: &mut Vec<[String; 4]>)

Source

fn default(c: &C) -> Self

Source

fn run(self, c: &C, r: Vec<&str>) -> Result<(), String>

Provided Methods§

Source

fn next_impl<'a>(c: &C, args: &[Arg<'a>]) -> Result<(), ErrArgs>

Source

fn next<'a>( c: &C, s: &mut ParseCtx<'a>, args: &[Arg<'a>], ) -> Result<(), ErrArgs>

Source

fn usage(c: &C) -> String

Source

fn full_usage(c: &C, exec: &str, pfx: &[&str]) -> String

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§