pub struct PassedFlags {
pub map: HashMap<String, String>,
}Expand description
Resolved flags delivered to the app’s main entry handler.
Constructed by crate::App::run when no subcommand is present and a main
entry point has been registered via crate::App::main. The inner map uses
canonical flag names as keys; boolean flags have the value "true".
Fields§
§map: HashMap<String, String>The raw resolved flag map. Prefer the accessor methods over direct access.
Implementations§
Source§impl PassedFlags
impl PassedFlags
Sourcepub fn get_flag_value(&self, name: &str) -> Option<&String>
pub fn get_flag_value(&self, name: &str) -> Option<&String>
Returns the value of a flag by its canonical name, if present.
Boolean flags (those with no explicit value) return "true".
Sourcepub fn contains_flag(&self, name: &str) -> bool
pub fn contains_flag(&self, name: &str) -> bool
Returns true if the named flag was passed by the user.
Auto Trait Implementations§
impl Freeze for PassedFlags
impl RefUnwindSafe for PassedFlags
impl Send for PassedFlags
impl Sync for PassedFlags
impl Unpin for PassedFlags
impl UnsafeUnpin for PassedFlags
impl UnwindSafe for PassedFlags
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more