Struct Flag
struct Flag<B> { ... }
A defined flags value that may be named or unnamed.
Implementations
impl<B> Flag<B>
const fn new(name: &'static str, value: B) -> SelfDefine a flag.
If
nameis non-empty then the flag is named, otherwise it's unnamed.const fn name(self: &Self) -> &'static strGet the name of this flag.
If the flag is unnamed then the returned string will be empty.
const fn value(self: &Self) -> &BGet the flags value of this flag.
const fn is_named(self: &Self) -> boolWhether the flag is named.
If
Flag::namereturns a non-empty string then this method will returntrue.const fn is_unnamed(self: &Self) -> boolWhether the flag is unnamed.
If
Flag::namereturns a non-empty string then this method will returnfalse.
impl<B> Freeze for Flag<B>
impl<B> RefUnwindSafe for Flag<B>
impl<B> Send for Flag<B>
impl<B> Sync for Flag<B>
impl<B> Unpin for Flag<B>
impl<B> UnsafeUnpin for Flag<B>
impl<B> UnwindSafe for Flag<B>
impl<B: $crate::fmt::Debug> Debug for Flag<B>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T> Any for Flag<B>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Flag<B>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Flag<B>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for Flag<B>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for Flag<B>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Flag<B>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Flag<B>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>