capsize
Conversions between units of capacity
docs
Find them here
install
Add the following to your Cargo.toml
[]
= "0.1.0"
usage
extern crate capsize;
use Capacity;
Doug Tangren (softprops) 2015
Conversions between units of capacity
Find them here
Add the following to your Cargo.toml
[dependencies]
capsize = "0.1.0"
extern crate capsize;
use capize::Capacity;
pub fn main() {
// get the equivilent number of bytes in 4 megabytes
let bytes = 4.megabytes();
println!("4 megabytes is {} bytes", bytes);
// resolve byte size to the closest human form
println!(bytes.capacity()); // 4.0K
}
Doug Tangren (softprops) 2015