pub trait Human: Sized {
type Rendered: Display;
// Required method
fn human(self) -> Self::Rendered;
}Expand description
A quantity that renders itself the way an operator would write it.
use krabka_units::{fmt::Human, prelude::*};
assert_eq!(mebibytes(512).human().to_string(), "512MiB");
assert_eq!(days(7).human().to_string(), "7d");
assert_eq!(mebibytes_per_sec(10).human().to_string(), "10MiB/s");Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".