pub struct EscalationLadder { /* private fields */ }Expand description
The precision tiers a filtered predicate steps through, weakest first.
This is the executable form of the fast-path/escalation design: try a cheap filter, and only pay for stronger arithmetic on the cases that need it. A backend advertises how far it can escalate; a caller learns whether the answer it got was cheap or expensive.
Implementations§
Source§impl EscalationLadder
impl EscalationLadder
Sourcepub const fn new(ceiling: Precision) -> EscalationLadder
pub const fn new(ceiling: Precision) -> EscalationLadder
A ladder that may escalate up to and including ceiling.
Sourcepub const fn exact() -> EscalationLadder
pub const fn exact() -> EscalationLadder
A ladder ending in exact arithmetic: every sign is decidable.
Sourcepub const fn is_total(self) -> bool
pub const fn is_total(self) -> bool
Whether reaching ceiling guarantees every sign becomes decidable.
Only exact arithmetic does. A ladder topping out at F64 can still
return Uncertain, and a caller that needs a decision must know that.
Sourcepub fn next_after(self, current: Precision) -> Option<Precision>
pub fn next_after(self, current: Precision) -> Option<Precision>
The next tier to try after current, or None at the ceiling.
Trait Implementations§
Source§impl Clone for EscalationLadder
impl Clone for EscalationLadder
Source§fn clone(&self) -> EscalationLadder
fn clone(&self) -> EscalationLadder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EscalationLadder
impl Debug for EscalationLadder
Source§impl Hash for EscalationLadder
impl Hash for EscalationLadder
Source§impl PartialEq for EscalationLadder
impl PartialEq for EscalationLadder
impl Copy for EscalationLadder
impl Eq for EscalationLadder
impl StructuralPartialEq for EscalationLadder
Auto Trait Implementations§
impl Freeze for EscalationLadder
impl RefUnwindSafe for EscalationLadder
impl Send for EscalationLadder
impl Sync for EscalationLadder
impl Unpin for EscalationLadder
impl UnwindSafe for EscalationLadder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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