Struct predicates_core::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>, 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.
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