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) -> Self

Define a flag.

If name is non-empty then the flag is named, otherwise it's unnamed.

const fn name(self: &Self) -> &'static str

Get the name of this flag.

If the flag is unnamed then the returned string will be empty.

const fn value(self: &Self) -> &B

Get the flags value of this flag.

const fn is_named(self: &Self) -> bool

Whether the flag is named.

If Flag::name returns a non-empty string then this method will return true.

const fn is_unnamed(self: &Self) -> bool

Whether the flag is unnamed.

If Flag::name returns a non-empty string then this method will return false.

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) -> T

Returns the argument unchanged.

impl<T, U> Into for Flag<B>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses 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>