Cooper.ByteSize (Cooper v0.7.0)

Copy Markdown View Source

A byte size (CASC.md §6.9): 512MiB, 10GB, !bytes("1.5GiB"), held in bytes.

A value of its own, not a tagged tuple, for the reason Cooper.Duration gives: {:bytes, n} was also what a document's tuple (bytes, 5) read as.

iex> {:ok, %{"m" => m}} = Cooper.load_string("#@version = 1.0\nm = 2KiB", dotenv: false)
iex> m
%Cooper.ByteSize{bytes: 2048}

Summary

Types

t()

@type t() :: %Cooper.ByteSize{bytes: integer()}