darling
darling copied to clipboard
RFE: Support negation for `Flag` (or new similar type)
In most configuration systems, a "key" when present let's enable (or enforce) associated feature activation. It is currently supported by Flag
type.
However, such systems also support disabling feature.
Example syntax:
#[my_attribute(!my_feature)]
Example (additional) API:
impl Flag {
fn is_enabled(self) -> bool { /* ... */ }
fn is_disabled(self) -> bool { /* ... */ }
fn as_option(self) -> Option<bool> { /* ... */ }
}
impl From<&Flag> for Option<bool> {
fn from(value: &Flag) -> Self {
value.as_option()
}
}
impl From<Option<bool>> for &Option<bool> {
fn from(value: Option<bool>) -> Self { /* ... */}
}