Struct predicates::reflection::Case
source · pub struct Case<'a> { /* private fields */ }
Expand description
A descriptive explanation for why a predicate failed.
Implementations
sourceimpl<'a> Case<'a>
impl<'a> Case<'a>
sourcepub fn new(
predicate: Option<&'a (dyn PredicateReflection + 'a)>,
result: bool
) -> Case<'a>
pub fn new(
predicate: Option<&'a (dyn PredicateReflection + 'a)>,
result: bool
) -> Case<'a>
Create a new Case
describing the result of a Predicate
.
sourcepub fn add_product(self, product: Product) -> Case<'a>
pub fn add_product(self, product: Product) -> Case<'a>
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<'_>ⓘNotable traits for CaseProducts<'a>impl<'a> Iterator for CaseProducts<'a> type Item = &'a Product;
pub fn products(&self) -> CaseProducts<'_>ⓘNotable traits for CaseProducts<'a>impl<'a> Iterator for CaseProducts<'a> type Item = &'a Product;
Access the by-products from determining this case.
sourcepub fn children(&self) -> CaseChildren<'_>ⓘNotable traits for CaseChildren<'a>impl<'a> Iterator for CaseChildren<'a> type Item = &'a Case<'a>;
pub fn children(&self) -> CaseChildren<'_>ⓘNotable traits for CaseChildren<'a>impl<'a> Iterator for CaseChildren<'a> type Item = &'a Case<'a>;
Access the sub-cases.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Case<'a>
impl<'a> !Send for Case<'a>
impl<'a> !Sync for Case<'a>
impl<'a> Unpin for Case<'a>
impl<'a> !UnwindSafe for Case<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more