pub struct Flag<B> { /* private fields */ }
Expand description
A defined flags value that may be named or unnamed.
Implementations§
Source§impl<B> Flag<B>
impl<B> Flag<B>
Sourcepub const fn new(name: &'static str, value: B) -> Self
pub const fn new(name: &'static str, value: B) -> Self
Define a flag.
If name
is non-empty then the flag is named, otherwise it’s unnamed.
Sourcepub const fn name(&self) -> &'static str
pub const fn name(&self) -> &'static str
Get the name of this flag.
If the flag is unnamed then the returned string will be empty.
Sourcepub const fn is_named(&self) -> bool
pub const fn is_named(&self) -> bool
Whether the flag is named.
If Flag::name
returns a non-empty string then this method will return true
.
Sourcepub const fn is_unnamed(&self) -> bool
pub const fn is_unnamed(&self) -> bool
Whether the flag is unnamed.
If Flag::name
returns a non-empty string then this method will return false
.