pub type ByteSize = Information;Expand description
A count of bytes: a message size, a segment size, a buffer capacity, a quota balance.
This is uom’s information dimension with f64 storage. The base unit is
the byte, so ByteSizeExt::bytes_u64 is
exact for every value the wire can carry. Construct with bytes,
kibibytes, mebibytes, or gibibytes.
Aliased Type§
#[repr(transparent)]pub struct ByteSize {
pub dimension: PhantomData<dyn Dimension<Kind = dyn InformationKind, M = Z0, I = Z0, T = Z0, Th = Z0, N = Z0, L = Z0, J = Z0>>,
pub units: PhantomData<dyn Units<f64, luminous_intensity = candela, amount_of_substance = mole, length = meter, electric_current = ampere, thermodynamic_temperature = kelvin, time = second, mass = kilogram>>,
pub value: f64,
}Fields§
§dimension: PhantomData<dyn Dimension<Kind = dyn InformationKind, M = Z0, I = Z0, T = Z0, Th = Z0, N = Z0, L = Z0, J = Z0>>Quantity dimension. See [Dimension].
units: PhantomData<dyn Units<f64, luminous_intensity = candela, amount_of_substance = mole, length = meter, electric_current = ampere, thermodynamic_temperature = kelvin, time = second, mass = kilogram>>Quantity base units. See [Units].
value: f64Quantity value stored in the base units for the quantity.
Trait Implementations§
Source§impl ByteSizeExt for ByteSize
impl ByteSizeExt for ByteSize
Source§fn from_bytes(bytes: u64) -> Self
fn from_bytes(bytes: u64) -> Self
A raw unsigned byte count.
Source§fn from_bytes_i64(bytes: i64) -> Self
fn from_bytes_i64(bytes: i64) -> Self
A raw signed byte count. This keeps the sign, so it also carries a
delta, for example a quota balance that has gone into deficit. This
function does not interpret Kafka’s
-1 “unlimited” sentinel. Use
wire::opt_size_from_bytes_i64 for that.Source§fn from_bytes_f64(bytes: f64) -> Self
fn from_bytes_f64(bytes: f64) -> Self
A raw byte count measured as a float (a sampled or averaged size).
Source§fn bytes_usize(self) -> usize
fn bytes_usize(self) -> usize
The count as a
usize, for buffer capacities and slice lengths.