teamy-uom-extensions

Crates.ioteamy-uom-extensions
lib.rsteamy-uom-extensions
version0.1.0
created_at2025-12-07 04:51:26.191674+00
updated_at2025-12-07 04:51:26.191674+00
descriptionSmall set of human-friendly display helpers for uom types (humantime + humansize integrations)
homepage
repositoryhttps://github.com/TeamDman/teamy-uom-extensions
max_upload_size
id1971176
size48,279
(TeamDman)

documentation

README

teamy-uom-extensions — quick demo

Tiny examples showing the core formatting helpers. These examples use the default features (human) so formatting helpers are available out of the box.

Information (bytes)

use teamy_uom_extensions::{HumanInformationExt, DECIMAL, BINARY};
use uom::si::f64::Information;
use uom::si::information::byte;

let i = Information::new::<byte>(1536.0);
println!("dec: {}  bin: {}", i.format_human(DECIMAL), i.format_human(BINARY));

Output (example):

dec: 1.54 kB  bin: 1.50 KiB

Time

use teamy_uom_extensions::HumanTimeExt;
use uom::si::f64::Time;
use uom::si::time::second;

let t = Time::new::<second>(90.0);
println!("human: {}  precise: {}", t.format_human(), t.format_human_precise());

Output (example):

human: 1m 30s  precise: 1m 30s

InformationRate

use teamy_uom_extensions::{HumanInformationRateExt, DECIMAL};
use uom::si::f64::InformationRate;
use uom::si::information_rate::byte_per_second;

let r = InformationRate::new::<byte_per_second>(2048.0);
println!("rate: {}", r.format_human(DECIMAL));

Output (example):

rate: 2.05 kB/s

That's it — quick, minimal examples to demonstrate the core helpers. For full examples see the examples/ directory.

Commit count: 0

cargo fmt