Struct predicates_core::reflection::Case
source · pub struct Case<'a> { /* private fields */ }
Expand description
A descriptive explanation for why a predicate failed.
Implementations§
source§impl<'a> Case<'a>
impl<'a> Case<'a>
sourcepub fn new(predicate: Option<&'a dyn PredicateReflection>, result: bool) -> Self
pub fn new(predicate: Option<&'a dyn PredicateReflection>, result: bool) -> Self
Create a new Case
describing the result of a Predicate
.
sourcepub fn add_product(self, product: Product) -> Self
pub fn add_product(self, product: Product) -> Self
Add an additional by product to a Case
.
sourcepub fn predicate(&self) -> Option<&dyn PredicateReflection>
pub fn predicate(&self) -> Option<&dyn PredicateReflection>
The Predicate
that produced this case.
sourcepub fn products(&self) -> CaseProducts<'_> ⓘ
pub fn products(&self) -> CaseProducts<'_> ⓘ
Access the by-products from determining this case.
sourcepub fn children(&self) -> CaseChildren<'_> ⓘ
pub fn children(&self) -> CaseChildren<'_> ⓘ
Access the sub-cases.