Trait MaybeExact

Source
pub trait MaybeExact {
    type Approximate;
    type Exact;

    // Required methods
    fn is_exact(&self) -> bool;
    fn extract_approx(&self) -> Result<Self::Approximate>;
    fn extract_exact(&self) -> Result<&Self::Exact>;
}

Required Associated Types§

Required Methods§

Source

fn is_exact(&self) -> bool

Source

fn extract_approx(&self) -> Result<Self::Approximate>

This is a low-level function to extract an f64. Will only succeed if the fraction is approximate.

Source

fn extract_exact(&self) -> Result<&Self::Exact>

This is a low-level function to extract an exact value. Will only succeed if the fraction is exact.

Implementors§