Skip to main content

ByteRate

Type Alias ByteRate 

Source
pub type ByteRate = InformationRate;
Expand description

A byte throughput: a producer quota, a replication rate, a measured send/receive rate.

Divide a ByteSize by a Time to get one. The uom product of two quantities erases the information kind, so the result needs .into().

Aliased Type§

#[repr(transparent)]
pub struct ByteRate { pub dimension: PhantomData<dyn Dimension<Kind = dyn InformationKind, M = Z0, I = Z0, T = NInt<UInt<UTerm, B1>>, 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 = NInt<UInt<UTerm, B1>>, 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: f64

Quantity value stored in the base units for the quantity.

Trait Implementations§

Source§

impl ByteRateExt for ByteRate

Source§

const ZERO: Self

No throughput.
Source§

fn from_bytes_per_sec(rate: i64) -> Self

A raw bytes-per-second rate, as Kafka’s quota configs express it.
Source§

fn from_bytes_per_sec_f64(rate: f64) -> Self

A fractional bytes-per-second rate, as a measurement produces it.
Source§

fn bytes_per_sec_f64(self) -> f64

The rate in bytes per second.
Source§

fn bytes_per_sec_i64(self) -> i64

The rate as Kafka’s int64 quota fields.
Source§

fn time_to_transfer(self, size: ByteSize) -> Time

How long transferring size takes at this rate. Read more
Source§

impl Human for ByteRate

Source§

type Rendered = HumanByteRate

The Display adapter this quantity renders through.
Source§

fn human(self) -> Self::Rendered

This quantity, ready to print.