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
.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Flag<B>where
B: Freeze,
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
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.