pub trait Args<T> {
// Required methods
fn has_help(&self) -> bool;
fn all(&self) -> Vec<T>;
}Expand description
Abstraction over command-line argument collections for help detection and access.
§Type Parameters
TThe type of individual arguments, typically string-like (e.g.,String,&str).
§Rationale
- Enables polymorphic argument handling without coupling to specific collection types.
- Centralizes help flag detection logic for consistency across binaries.
- Supports both owned and borrowed argument slices for flexibility.
§Performance
has_helpperforms a linear scan; suitable for small argument lists (typical CLI usage).allclones arguments; use borrowed types (T = &str) to avoid allocation overhead.