pub struct Binary(pub f64);
Expand description
Helper struct to compactly format a value with a binary unit prefix
If the provided value is equal to 0 or is in [1e-2, 1e28), this will produce at most 7 ASCII characters.
Examples
assert_eq!(format!("{}B/s", yapb::prefix::Binary(12345.0)), "12.1 KiB/s");
Tuple Fields
0: f64
Trait Implementations
impl Copy for Binary
Auto Trait Implementations
impl RefUnwindSafe for Binary
impl Send for Binary
impl Sync for Binary
impl Unpin for Binary
impl UnwindSafe for Binary
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