pub trait Visitor<'arg> {
type Value;
// Required methods
fn visit_positional(self, argument: &'arg Arg) -> Self::Value;
fn visit_long_option(
self,
option: &'arg Arg,
argument: &'arg Arg,
) -> Self::Value;
fn visit_long(
self,
option: &'arg Arg,
arg: impl ArgAccess<'arg>,
) -> Self::Value;
fn visit_short(self, option: u8, arg: impl ArgAccess<'arg>) -> Self::Value;
}
Expand description
The ArgumentsParser
type operates by passing arguments it finds into a
Visitor
, to be handled.
Required Associated Types§
Required Methods§
Sourcefn visit_positional(self, argument: &'arg Arg) -> Self::Value
fn visit_positional(self, argument: &'arg Arg) -> Self::Value
A positional parameter.
Sourcefn visit_long_option(
self,
option: &'arg Arg,
argument: &'arg Arg,
) -> Self::Value
fn visit_long_option( self, option: &'arg Arg, argument: &'arg Arg, ) -> Self::Value
A long option that definitely has an argument, because it was given
as --option=argument
Sourcefn visit_long(self, option: &'arg Arg, arg: impl ArgAccess<'arg>) -> Self::Value
fn visit_long(self, option: &'arg Arg, arg: impl ArgAccess<'arg>) -> Self::Value
A long option or flag, such as --option
Sourcefn visit_short(self, option: u8, arg: impl ArgAccess<'arg>) -> Self::Value
fn visit_short(self, option: u8, arg: impl ArgAccess<'arg>) -> Self::Value
A long option or flag, such as -o
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.