parallel_disk_usage/bytes_format/
parsed_value.rs

1use derive_more::{Display, Error};
2
3/// Return value of [`Formatter::parse_value`](super::Formatter::parse_value).
4#[derive(Debug, Display, Clone, Copy, Error)]
5pub enum ParsedValue {
6    /// When input value is less than `scale_base`.
7    #[display("{value}   ")]
8    Small {
9        /// Input value that is less than `scale_base`.
10        value: u16,
11    },
12    /// When input value is greater than `scale_base`.
13    #[display("{coefficient:.1}{unit}")]
14    Big {
15        /// The visible part of the number.
16        coefficient: f32,
17        /// The unit that follows `coefficient`.
18        unit: char,
19        /// The divisor that was used upon the original number to get `coefficient`.
20        scale: u64,
21        /// The exponent that was used upon base scale to get `scale`.
22        exponent: usize,
23    },
24}