docs.rs failed to build human-units-0.1.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
human-units-0.5.3
Introduction
human-units is a library with Size and Duration types specifically designed to be used in configuration files and as command line arguments.
These types serialize sizes and durations in exact but human-readable form.
The library also provides [FormatSize] and [FormatDuration] traits
to print approximate sizes and durations in a short human-readable form.
- No floating point operations.
- No dependencies by default.
- Supports Serde.
- Supports
no_std. - Tested with Miri.
Examples
Exact human-readable size/duration
use ;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Inexact short human-readable size/duration
use Duration;
use ;
assert_eq!;
assert_eq!;
Custom output
use Colorize;
use Duration;
use ;
/// Prints the unit in cyan.
;
// prints "1 m ago", "m" is printed with cyan color
println!;
Serde integration
use Size;
use Serialize;
let object = SizeWrapper;
assert_eq!;