Enum dashu_base::approx::Approximation
source · [−]pub enum Approximation<T, E> {
Exact(T),
Inexact(T, E),
}
Expand description
Represent an calculation result with a possible error.
Variants
Exact(T)
The result is exact, contains the result value
Inexact(T, E)
The result is inexact, contains the result value and error
Implementations
sourceimpl<T, E> Approximation<T, E>
impl<T, E> Approximation<T, E>
pub fn error(&self) -> Option<&E>
pub fn map<U, F>(self, f: F) -> Approximation<U, E>where
F: FnOnce(T) -> U,
pub fn and_then<U, F>(self, f: F) -> Approximation<U, E>where
F: FnOnce(T) -> Approximation<U, E>,
Trait Implementations
sourceimpl<T: Clone, E: Clone> Clone for Approximation<T, E>
impl<T: Clone, E: Clone> Clone for Approximation<T, E>
sourcefn clone(&self) -> Approximation<T, E>
fn clone(&self) -> Approximation<T, E>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: Debug, E: Debug> Debug for Approximation<T, E>
impl<T: Debug, E: Debug> Debug for Approximation<T, E>
sourceimpl<T: PartialEq, E: PartialEq> PartialEq<Approximation<T, E>> for Approximation<T, E>
impl<T: PartialEq, E: PartialEq> PartialEq<Approximation<T, E>> for Approximation<T, E>
sourcefn eq(&self, other: &Approximation<T, E>) -> bool
fn eq(&self, other: &Approximation<T, E>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
impl<T: Copy, E: Copy> Copy for Approximation<T, E>
impl<T: Eq, E: Eq> Eq for Approximation<T, E>
impl<T, E> StructuralEq for Approximation<T, E>
impl<T, E> StructuralPartialEq for Approximation<T, E>
Auto Trait Implementations
impl<T, E> RefUnwindSafe for Approximation<T, E>where
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, E> Send for Approximation<T, E>where
E: Send,
T: Send,
impl<T, E> Sync for Approximation<T, E>where
E: Sync,
T: Sync,
impl<T, E> Unpin for Approximation<T, E>where
E: Unpin,
T: Unpin,
impl<T, E> UnwindSafe for Approximation<T, E>where
E: UnwindSafe,
T: UnwindSafe,
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