1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Human-readable byte-size formatting.
//!
//! Use this module when you want decimal or binary byte units without pulling
//! formatting logic into application code.
pub use BytesDisplay;
pub use BytesOptions;
pub use BytesLike;
/// Creates a human-readable byte-size formatter using default decimal units.
///
/// # Examples
///
/// ```rust
/// assert_eq!(humfmt::bytes(1536).to_string(), "1.5KB");
/// ```
/// Creates a human-readable byte-size formatter with custom options.
///
/// # Examples
///
/// ```rust
/// use humfmt::BytesOptions;
///
/// let out = humfmt::bytes_with(1536, BytesOptions::new().binary());
/// assert_eq!(out.to_string(), "1.5KiB");
/// ```