# `Unit.Bandwidth`
[🔗](https://github.com/harmont-dev/hyper/blob/main/lib/unit/bandwidth.ex#L1)

A throughput, stored canonically in bytes per second. Build with `bps/1` or the
binary-prefix constructors (`kibps/1`, `mibps/1`, `gibps/1`, `tibps/1`); read back
with `as_bytes_per_sec/1`. Arithmetic (`+`, `-`) and comparison
(`<`, `>`, `<=`, `>=`) come from `Unit.Operators`.

# `t`

```elixir
@opaque t()
```

# `as_bytes_per_sec`

```elixir
@spec as_bytes_per_sec(t()) :: integer()
```

# `bps`

```elixir
@spec bps(integer()) :: t()
```

# `gibps`

```elixir
@spec gibps(integer()) :: t()
```

# `kibps`

```elixir
@spec kibps(integer()) :: t()
```

# `mibps`

```elixir
@spec mibps(integer()) :: t()
```

# `parse`

```elixir
@spec parse(String.t()) :: {:ok, t()} | {:error, {:bad_unit, String.t()}}
```

Parse a string like `"1GiBps"`. Suffixes: Bps/KiBps/MiBps/GiBps/TiBps.

# `parse!`

```elixir
@spec parse!(String.t()) :: t()
```

Like `parse/1` but raises `ArgumentError` on bad input.

# `tibps`

```elixir
@spec tibps(integer()) :: t()
```

# `zero`

```elixir
@spec zero() :: t()
```

The zero throughput (additive identity).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
