Struct Args

Source
pub struct Args<'app> { /* private fields */ }
Expand description

Args

Implementations§

Source§

impl<'app> Args<'app>

Source

pub fn new<'s: 'app, V>(name: &'app str, value: V) -> Self
where V: ArgsValueParse<'app>,

Source

pub fn len<L: Into<usize>>(self, len: L) -> Self

Source

pub fn optional(self) -> Self

set Argss optional as true(default is false)(override ArgsValueParse’s default and check).

Source

pub fn help(self, help: &'app str) -> Self

help message

Source§

impl<'app> Args<'app>

Source

pub fn value(&self) -> &'app ArgsValue<'_>

Source

pub fn value_mut(&mut self) -> &'app mut ArgsValue<'_>

Source

pub fn is_optional(&self) -> bool

Source

pub fn name_get(&self) -> &'app str

Source

pub fn help_get(&self) -> &str

Source

pub fn count_get(&self) -> &usize

Trait Implementations§

Source§

impl<'app> Debug for Args<'app>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'app> Freeze for Args<'app>

§

impl<'app> !RefUnwindSafe for Args<'app>

§

impl<'app> !Send for Args<'app>

§

impl<'app> !Sync for Args<'app>

§

impl<'app> Unpin for Args<'app>

§

impl<'app> !UnwindSafe for Args<'app>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.