Struct Opt

Source
pub struct Opt<'a> { /* private fields */ }
Expand description

A command line option.

Implementations§

Source§

impl<'a> Opt<'a>

Source

pub fn desc<'b: 'a>(&mut self, desc: &'b str) -> &mut Self

Set the description string of this option.

Source

pub fn varname(&mut self, varname: &str) -> &mut Self

Set long or short name from the given variable name.

Source

pub fn required(&mut self, required: bool) -> &mut Self

Mark this option as required.

Source

pub fn long(&mut self, long: &str) -> &mut Self

Set the long option of this option.

Source

pub fn short(&mut self, short: char) -> &mut Self

Set the short option of this option.

Source

pub fn name(&mut self, name: &str) -> &mut Self

Set the name of the option’s argument.

Source

pub fn multi(&mut self, multi: bool) -> &mut Self

Set whether this is a multi-argument option.

Auto Trait Implementations§

§

impl<'a> Freeze for Opt<'a>

§

impl<'a> !RefUnwindSafe for Opt<'a>

§

impl<'a> !Send for Opt<'a>

§

impl<'a> !Sync for Opt<'a>

§

impl<'a> Unpin for Opt<'a>

§

impl<'a> !UnwindSafe for Opt<'a>

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.