ArgumentSetMethods

Trait ArgumentSetMethods 

Source
pub trait ArgumentSetMethods: Copy + Sized {
    type Each: Sized;
    type Field: Sized;

    // Required method
    fn parse_with<P>(
        self,
        args: &mut ArgumentStream<'_>,
        field: &'static str,
        parser: P,
    ) -> Result<Self::Field, EP>
       where P: for<'s> Fn(&mut ArgumentStream<'s>, &'static str) -> Result<Self::Each, EP>;

    // Provided method
    fn check_argument_value_parseable(self)
       where Self::Each: ItemArgumentParseable { ... }
}
Available on crate feature parse2 only.
Expand description

Method for handling some multiplicity of Arguments

For use by macros.

See ArgumentSetSelector and the module-level docs.

Required Associated Types§

Source

type Each: Sized

The value for each Item.

Source

type Field: Sized

The output type: the type of the field in the Item struct.

This is not the type of an individual netdoc argument; that is not explicity represented in the trait.

Required Methods§

Source

fn parse_with<P>( self, args: &mut ArgumentStream<'_>, field: &'static str, parser: P, ) -> Result<Self::Field, EP>
where P: for<'s> Fn(&mut ArgumentStream<'s>, &'static str) -> Result<Self::Each, EP>,

Parse zero or more argument(s) into Self::Field.

Provided Methods§

Source

fn check_argument_value_parseable(self)

Check that the element type is an Argument

For providing better error messages when struct fields don’t implement the right trait. See derive.rs, and search for this method name.

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§