Bandwidth

github-repo crates.io docs.rs LICENSE Apache-2.0

A library for representing bandwidth speed in a variety of units, mimicking the core::time::Duration struct.]

Usage

More detailed usage can be found on documentation.

```rust use bandwidth::Bandwidth;

let fivegbps = Bandwidth::fromgbps(5); asserteq!(fivegbps, Bandwidth::frommbps(5000)); asserteq!(fivegbps, Bandwidth::fromkbps(5000000)); asserteq!(fivegbps, Bandwidth::frombps(5000000_000));

let tengbps = Bandwidth::fromgbps(10); let sevenbps = Bandwidth::frombps(7); let total = tengbps + sevenbps; assert_eq!(total, Bandwidth::new(10, 7)); ```

Maintainer

@BobAnkh

How to contribute

You should follow our Code of Conduct.

See CONTRIBUTING GUIDELINES for contributing conventions.

Make sure to pass all the tests before submitting your code.

Contributors

Yixin
Yixin Shen

LICENSE

Apache-2.0 © stack-rs