repr-size

Crates.iorepr-size
lib.rsrepr-size
version0.1.2
sourcesrc
created_at2022-05-18 20:53:15.256251
updated_at2022-05-19 12:59:03.589664
descriptionErgonomic functions to display a count of bytes to an end user.
homepage
repositoryhttps://github.com/tyush/repr-bytes
max_upload_size
id589237
size8,899
(tyush)

documentation

README

repr-bytes

Small, simple library to convert byte amounts to pretty, human readable sizes.

Quickstart

let my_file_size = Size::from(54222);

println!("{}", my_file_size); // "54.2 KB"
println!("{}", my_file_size.to_si_string()); // "53.0 KiB"
println!("{}", my_file_size.repr(Units::Bytes)); // "54222 B"

Features

serde - enables serialization/deserialization of Size <-> usize

Commit count: 14

cargo fmt