Opt

Trait Opt 

Source
pub trait Opt: Debug {
Show 39 methods // Required methods fn reset(&mut self); fn uid(&self) -> u64; fn name(&self) -> &str; fn type(&self) -> &TypeId; fn hint(&self) -> &str; fn help(&self) -> &str; fn valid(&self) -> bool; fn matched(&self) -> bool; fn force(&self) -> bool; fn action(&self) -> &Action; fn index(&self) -> Option<&Index>; fn alias(&self) -> Option<&Vec<String>>; fn accessor(&self) -> &ValAccessor; fn accessor_mut(&mut self) -> &mut ValAccessor; fn ignore_alias(&self) -> bool; fn ignore_name(&self) -> bool; fn ignore_index(&self) -> bool; fn set_uid(&mut self, uid: u64); fn set_matched(&mut self, matched: bool); fn mat_style(&self, style: Style) -> bool; fn mat_force(&self, force: bool) -> bool; fn mat_name(&self, name: Option<&str>) -> bool; fn mat_alias(&self, name: &str) -> bool; fn mat_index(&self, index: Option<(usize, usize)>) -> bool; fn init(&mut self) -> Result<(), Error>; fn set_name(&mut self, name: impl Into<String>) -> &mut Self; fn set_type(&mut self, type: TypeId) -> &mut Self; fn set_value(&mut self, value: ValAccessor) -> &mut Self; fn set_hint(&mut self, hint: impl Into<String>) -> &mut Self; fn set_help(&mut self, help: impl Into<String>) -> &mut Self; fn set_action(&mut self, action: Action) -> &mut Self; fn set_style(&mut self, styles: Vec<Style>) -> &mut Self; fn set_index(&mut self, index: Option<Index>) -> &mut Self; fn set_force(&mut self, force: bool) -> &mut Self; fn add_alias(&mut self, name: impl Into<String>) -> &mut Self; fn rem_alias(&mut self, name: &str) -> &mut Self; fn set_ignore_name(&mut self, ignore_name: bool) -> &mut Self; fn set_ignore_alias(&mut self, ignore_alias: bool) -> &mut Self; fn set_ignore_index(&mut self, ignore_index: bool) -> &mut Self;
}

Required Methods§

Source

fn reset(&mut self)

Source

fn uid(&self) -> u64

The Uid of option.

Source

fn name(&self) -> &str

The name of option.

Source

fn type(&self) -> &TypeId

The type of option.

Source

fn hint(&self) -> &str

The help hint of option such as --flag.

Source

fn help(&self) -> &str

The help message of option.

Source

fn valid(&self) -> bool

Source

fn matched(&self) -> bool

If the option matched.

Source

fn force(&self) -> bool

If the option is force required.

Source

fn action(&self) -> &Action

The associaed action of option.

Source

fn index(&self) -> Option<&Index>

The index of option.

Source

fn alias(&self) -> Option<&Vec<String>>

The alias the option.

Source

fn accessor(&self) -> &ValAccessor

Source

fn accessor_mut(&mut self) -> &mut ValAccessor

Source

fn ignore_alias(&self) -> bool

Source

fn ignore_name(&self) -> bool

Source

fn ignore_index(&self) -> bool

Source

fn set_uid(&mut self, uid: u64)

Source

fn set_matched(&mut self, matched: bool)

Source

fn mat_style(&self, style: Style) -> bool

Source

fn mat_force(&self, force: bool) -> bool

Source

fn mat_name(&self, name: Option<&str>) -> bool

Source

fn mat_alias(&self, name: &str) -> bool

Source

fn mat_index(&self, index: Option<(usize, usize)>) -> bool

Source

fn init(&mut self) -> Result<(), Error>

Source

fn set_name(&mut self, name: impl Into<String>) -> &mut Self

Source

fn set_type(&mut self, type: TypeId) -> &mut Self

Source

fn set_value(&mut self, value: ValAccessor) -> &mut Self

Source

fn set_hint(&mut self, hint: impl Into<String>) -> &mut Self

Source

fn set_help(&mut self, help: impl Into<String>) -> &mut Self

Source

fn set_action(&mut self, action: Action) -> &mut Self

Source

fn set_style(&mut self, styles: Vec<Style>) -> &mut Self

Source

fn set_index(&mut self, index: Option<Index>) -> &mut Self

Source

fn set_force(&mut self, force: bool) -> &mut Self

Source

fn add_alias(&mut self, name: impl Into<String>) -> &mut Self

Source

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

Source

fn set_ignore_name(&mut self, ignore_name: bool) -> &mut Self

Source

fn set_ignore_alias(&mut self, ignore_alias: bool) -> &mut Self

Source

fn set_ignore_index(&mut self, ignore_index: bool) -> &mut Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Opt for AOpt