pub struct DnfExpr { /* private fields */ }Expand description
A #[cfg] directive in Disjunctive Normal Form (DNF).
Implementations§
Source§impl DnfExpr
impl DnfExpr
pub fn new(expr: &CfgExpr) -> Self
Sourcepub fn why_inactive(&self, opts: &CfgOptions) -> Option<InactiveReason>
pub fn why_inactive(&self, opts: &CfgOptions) -> Option<InactiveReason>
Computes a list of present or absent atoms in opts that cause this expression to evaluate
to false.
Note that flipping a subset of these atoms might be sufficient to make the whole expression
evaluate to true. For that, see compute_enable_hints.
Returns None when self is already true, or contains errors.
Sourcepub fn compute_enable_hints<'a>(
&'a self,
opts: &'a CfgOptions,
) -> impl Iterator<Item = CfgDiff> + 'a
pub fn compute_enable_hints<'a>( &'a self, opts: &'a CfgOptions, ) -> impl Iterator<Item = CfgDiff> + 'a
Returns CfgDiff objects that would enable this directive if applied to opts.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DnfExpr
impl RefUnwindSafe for DnfExpr
impl Send for DnfExpr
impl Sync for DnfExpr
impl Unpin for DnfExpr
impl UnwindSafe for DnfExpr
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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