Skip to main content

Parsed

Struct Parsed 

Source
pub struct Parsed {
    pub seen: BTreeMap<&'static str, Seen>,
}
Expand description

The parsed command line, by Argument::key.

Fields§

§seen: BTreeMap<&'static str, Seen>

The arguments given.

Implementations§

Source§

impl Parsed

Source

pub fn flag(&self, key: &str) -> bool

Whether the argument was given.

Source

pub fn count(&self, key: &str) -> usize

How often the argument was given.

Source

pub fn get(&self, key: &str) -> Option<&Seen>

The values of the argument, if it was given.

Source

pub fn str(&self, key: &str) -> Option<&str>

The value of an argument taking one value, if it was given.

Source

pub fn list(&self, key: &str) -> &[String]

The values of an argument taking nargs="*" or "+" (empty if it was not given).

Trait Implementations§

Source§

impl Clone for Parsed

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Parsed

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Parsed

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for Parsed

§

impl Freeze for Parsed
where *const LeafNode<&'static str, Seen> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(&'static str, Seen)>>: Freeze,

§

impl Move for Parsed

§

impl RefUnwindSafe for Parsed

§

impl Send for Parsed
where NodeRef<Owned, &'static str, Seen, LeafOrInternal>: Send, BoxRaw<(&'static str, Seen)>: Send,

§

impl Sync for Parsed
where NodeRef<Owned, &'static str, Seen, LeafOrInternal>: Sync, BoxRaw<(&'static str, Seen)>: Sync,

§

impl Unpin for Parsed
where *const LeafNode<&'static str, Seen> is !null: Unpin, Box<(&'static str, Seen)>: Unpin,

§

impl UnsafeUnpin for Parsed
where *const LeafNode<&'static str, Seen> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(&'static str, Seen)>>: UnsafeUnpin,

§

impl UnwindSafe for Parsed
where BTreeMap<&'static str, Seen>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.