pub enum Tri {
Yes,
No,
Unknown,
}Expand description
A three-valued answer.
Tri::Unknown means “not decided”, and every consumer must treat it as a
refusal rather than a maybe-yes. There is deliberately no conversion to
bool that guesses.
Variants§
Implementations§
Source§impl Tri
impl Tri
Sourcepub fn is_unknown(self) -> bool
pub fn is_unknown(self) -> bool
Whether the answer is undecided.
Sourcepub fn and(self, other: Self) -> Self
pub fn and(self, other: Self) -> Self
Conjunction: No dominates, then Unknown.
A definite No survives an undecided sibling — if one conjunct is
already false the whole thing is false regardless.
Sourcepub fn all(items: impl IntoIterator<Item = Self>) -> Self
pub fn all(items: impl IntoIterator<Item = Self>) -> Self
Fold a sequence with Tri::and, starting from Yes.
Sourcepub fn any(items: impl IntoIterator<Item = Self>) -> Self
pub fn any(items: impl IntoIterator<Item = Self>) -> Self
Fold a sequence with Tri::or, starting from No.
Trait Implementations§
impl Copy for Tri
impl Eq for Tri
impl StructuralPartialEq for Tri
Auto Trait Implementations§
impl Freeze for Tri
impl RefUnwindSafe for Tri
impl Send for Tri
impl Sync for Tri
impl Unpin for Tri
impl UnsafeUnpin for Tri
impl UnwindSafe for Tri
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