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) -> Flag<B>
pub const fn new(name: &'static str, value: B) -> Flag<B>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more