pub trait Occurrence: Sized {
const PREFIXES: &'static [u8] = _;
const ITEMS: &'static [Item] = _;
const POSITIONAL: bool = false;
const BUNDLES: bool = false;
// Required methods
fn from_arg<'i>(
arg: &Arg<'i>,
input: &mut Argv<'i>,
) -> Result<Option<Self>, Error>;
fn from_word(word: &Word<'_>) -> Result<Option<Self>, Error>;
fn is_long(name: &[u8]) -> bool;
// Provided methods
fn from_bundle(word: &Word<'_>) -> Result<Option<Self>, Error> { ... }
fn from_unknown(word: &Word<'_>) -> Result<Option<Self>, Error> { ... }
fn short(letter: char) -> Option<bool> { ... }
}Expand description
Flags and words kept in command-line order: an enum deriving Occurrence,
one variant per flag or positional, collected by an #[arg(sequence)]
Vec field of an Args struct.
For command lines where position is meaning, as ld’s: --as-needed and
--whole-archive apply to the inputs after them, so the linker folds the
sequence rather than reading fields.
Provided Associated Constants§
Sourceconst PREFIXES: &'static [u8] = _
const PREFIXES: &'static [u8] = _
Letters that always take the rest of their word (-lfoo), for a
long_only parent: no single-dash long name starting with one is tried.
Sourceconst ITEMS: &'static [Item] = _
const ITEMS: &'static [Item] = _
The variants as help lists them, after the parent’s own flags.
Sourceconst POSITIONAL: bool = false
const POSITIONAL: bool = false
Whether there is a positional variant: each plain word is that variant.
Required Methods§
Sourcefn from_arg<'i>(
arg: &Arg<'i>,
input: &mut Argv<'i>,
) -> Result<Option<Self>, Error>
fn from_arg<'i>( arg: &Arg<'i>, input: &mut Argv<'i>, ) -> Result<Option<Self>, Error>
arg as one of the variants, its value read from input; None when
no variant is spelled so.
Provided Methods§
Sourcefn from_bundle(word: &Word<'_>) -> Result<Option<Self>, Error>
fn from_bundle(word: &Word<'_>) -> Result<Option<Self>, Error>
A word of several short flags (-sS), whole, as the #[arg(bundle)]
variant: an item put before those of its letters, whoever takes them,
for a program that reports grouping (GNU ld deprecates it). None if
there is none.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".