clap_builder/parser/matches/
value_source.rs1#[derive(#[automatically_derived]
impl ::core::fmt::Debug for ValueSource {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
ValueSource::DefaultValue => "DefaultValue",
ValueSource::EnvVariable => "EnvVariable",
ValueSource::CommandLine => "CommandLine",
})
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for ValueSource {
#[inline]
fn clone(&self) -> ValueSource { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for ValueSource { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for ValueSource {
#[inline]
fn eq(&self, other: &ValueSource) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for ValueSource {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialOrd for ValueSource {
#[inline]
fn partial_cmp(&self, other: &ValueSource)
-> ::core::option::Option<::core::cmp::Ordering> {
::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
}
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Ord for ValueSource {
#[inline]
fn cmp(&self, other: &ValueSource) -> ::core::cmp::Ordering {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
}
}Ord)]
3#[non_exhaustive]
4pub enum ValueSource {
5 DefaultValue,
7 EnvVariable,
9 CommandLine,
11}
12
13impl ValueSource {
14 pub(crate) fn is_explicit(self) -> bool {
15 self != Self::DefaultValue
16 }
17}