capsize 0.1.1

A converter for units of capacity
Documentation
  • Coverage
  • 100%
    11 out of 11 items documented1 out of 11 items with examples
  • Size
  • Source code size: 9.15 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 421.73 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • Documentation
  • softprops/capsize
    4 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • softprops

capsize

Build Status

Conversions between units of capacity

docs

Find them here

install

Add the following to your Cargo.toml

[dependencies]
capsize = "0.1.0"

usage

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