Crate human_bandwidth

Crate human_bandwidth 

Source
Expand description

Human-friendly bandwidth parser and formatter

§Facilities:

  • Parses bandwidth in free form like 2Gbps 340Mbps or 2.34Gbps
  • Formats bandwidth in similar form 150.024kbps (default) or 150kbps 24bps (with feature display-integer enabled)

§Features

  • Enable serde feature for serde integration.
  • Enable display-integer feature to display integer values only.
  • Enable binary-system feature to display in binary prefix system (e.g. 1kiB/s instead of 8.192kbps)

Modules§

binary_system
Module to allow the display of bandwidth in binary prefix system
option
Convenience module to allow serialization for Option
re
Reexport module
serde
Serde support for humanized bandwidth.

Structs§

FormattedBandwidth
A wrapper type that allows you to Display a Bandwidth

Enums§

Error
Error parsing human-friendly bandwidth

Functions§

format_bandwidth
Formats bandwidth into a human-readable string
parse_bandwidth
Parse bandwidth object 1Gbps 12Mbps 5bps or 1.012000005Gbps