beetle_fraction/types.rs
1//! Type definitions & their non-trait impl's
2
3/// Operations involving Fractions that return `Result`s will return one of these variants as an `Err`
4#[derive(Debug, Copy, Clone)]
5pub enum FractionError {
6 /// Denotes that a Fraction was created whose denominator was zero, and thus considered an error in its context.
7 ImpliedDivisionByZero,
8
9 /// Represents the failure of an operation when the `numerator` of the fraction overflows
10 NumeratorOverflow,
11
12 /// Represents the failure of an operation when the `denominator` of the fraction overflows
13 DenominatorOverflow,
14
15 /// Used to denote when casting a string as a Fraction failed
16 UnableToParseString,
17
18 /// Represents a failure to parse a Float in some misc. way
19 FailureToParseFloat,
20}