pub enum OptionKey {
Type(TypeKey),
Data(Name),
}Expand description
The identifier of an option type: a Rust type, or a name given as data.
An option type declared with a Rust type has no name of its own: a feature
declares it once, and every other piece of code refers to it by its Rust
type (OptionKey::of). An option type declared from data
(SettingsDecl::options_data,
SettingsDecl::config_data)
is referred to by its name (OptionKey::named), and its values are
DataValues. A type key and a data key never compare equal.
Keys order the type keys first, by the type’s name, then the data keys, by
their name, so a collection keyed by them is visited in the same order in
every build and every process. The Debug form is OptionKey(NAME) and the
Display form is short_name.
Variants§
Type(TypeKey)
An option type that is a Rust type.
Data(Name)
An option type declared from data, named by the feature’s name (a configuration) or by a name the feature gives (an option type).
Implementations§
Source§impl OptionKey
impl OptionKey
Sourcepub fn named(name: impl Into<Name>) -> OptionKey
pub fn named(name: impl Into<Name>) -> OptionKey
The key of the option type declared from data under the name name.
Sourcepub fn short_name(&self) -> &str
pub fn short_name(&self) -> &str
The name messages show: the Rust type’s name without its module path
(short_type_name), or the name of an option type declared from data.
Trait Implementations§
impl Eq for OptionKey
Source§impl Ord for OptionKey
impl Ord for OptionKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for OptionKey
impl PartialOrd for OptionKey
impl StructuralPartialEq for OptionKey
Auto Trait Implementations§
impl Forget for OptionKey
impl Freeze for OptionKey
impl Move for OptionKey
impl RefUnwindSafe for OptionKey
impl Send for OptionKey
impl Sync for OptionKey
impl Unpin for OptionKey
impl UnsafeUnpin for OptionKeywhere
&'static str: UnsafeUnpin,
*const (): UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
impl UnwindSafe for OptionKey
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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