Expand description
A collection of constants for base-2 and base-10 units.
These can be used in a const
context in conjunction with the const
Size::from_const()
function to create strongly-sized Size
objects expressing various sizes, e.g.
use size::Size;
use size::consts::*;
pub const TOTAL_SIZE: Size = Size::from_const(3 * MiB);
Constants
Basic “byte” constant, used across all bases.
Base-10 “exabyte” constant, equal to 1000 petabytes.
Base-2 “exbibyte” constant, equal to 2^60 bytes.
Base-2 “gibibyte” constant, equal to 2^30 bytes.
Base-10 “gigabyte” constant, equal to 1000 megabytes.
Base-2 “kibibyte” constant, equal to 2^10 bytes.
Base-10 “kilobyte” constant, equal to 1000 bytes.
Base-2 “mebibyte” constant, equal to 2^20 bytes.
Base-10 “megabyte” constant, equal to 1000 kilobytes.
Base-2 “pebibyte” constant, equal to 2^50 bytes.
Base-10 “petabyte” constant, equal to 1000 terabytes.
Base-2 “tebibyte” constant, equal to 2^40 bytes.
Base-10 “terabyte” constant, equal to 1000 gigabytes.