Struct Flag
pub struct Flag<B> { /* private fields */ }
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) -> &'static strGet the name of this flag.
If the flag is unnamed then the returned string will be empty.
const fn value(&self) -> &BGet the flags value of this flag.
const fn is_named(&self) -> boolWhether the flag is named.
If
Flag::namereturns a non-empty string then this method will returntrue.const fn is_unnamed(&self) -> boolWhether the flag is unnamed.
If
Flag::namereturns a non-empty string then this method will returnfalse.
Trait Implementations
impl<B: Debug> Debug for Flag<B>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
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> UnsafeUnpin for Flag<B>
where
B: UnsafeUnpin,
impl<B> UnwindSafe for Flag<B>
where
B: UnwindSafe,
Blanket Implementations
impl<T> Any for Flag<B>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Flag<B>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Flag<B>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Flag<B>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for Flag<B>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Flag<B>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Flag<B>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>