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§
Required Methods§
Sourcefn parse_with<P>(
self,
args: &mut ArgumentStream<'_>,
field: &'static str,
parser: P,
) -> Result<Self::Field, EP>
fn parse_with<P>( self, args: &mut ArgumentStream<'_>, field: &'static str, parser: P, ) -> Result<Self::Field, EP>
Parse zero or more argument(s) into Self::Field
.
Provided Methods§
Sourcefn check_argument_value_parseable(self)where
Self::Each: ItemArgumentParseable,
fn check_argument_value_parseable(self)where
Self::Each: ItemArgumentParseable,
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.