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
.
Auto Trait Implementations§
impl<B> RefUnwindSafe for Flag<B>where B: RefUnwindSafe,
impl<B> Send for Flag<B>where B: Send,
impl<B> Sync for Flag<B>where B: Sync,
impl<B> Unpin for Flag<B>where B: Unpin,
impl<B> UnwindSafe for Flag<B>where B: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more