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<&'a str>, p: &mut Vec<Vec<&'a str>>);
    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: &[&'a str]) -> Result<(), ErrArgs> { ... }
    fn next<'a>(
        c: &C,
        _: &mut ParseCtx<'a>,
        args: &[&'a str],
    ) -> Result<(), ErrArgs> { ... }
    fn usage(c: &C) -> 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<&'a str>, p: &mut Vec<Vec<&'a str>>)

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: &[&'a str]) -> Result<(), ErrArgs>

Source

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

Source

fn usage(c: &C) -> String

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§