pub type Time = Time;Expand description
An extent of time: a timeout, a retention window, a backoff, a measured latency.
This is not an instant. See the crate docs. Construct with nanos, micros,
millis, secs, minutes, hours, or days, or convert from
core::time::Duration with
TimeExt::from_std.
Aliased Type§
#[repr(transparent)]pub struct Time {
pub dimension: PhantomData<dyn Dimension<Kind = dyn Kind, M = Z0, I = Z0, T = PInt<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 Kind, M = Z0, I = Z0, T = PInt<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: f64Quantity value stored in the base units for the quantity.
Trait Implementations§
Source§impl TimeExt for Time
impl TimeExt for Time
Source§fn from_millis(millis: i64) -> Self
fn from_millis(millis: i64) -> Self
A raw millisecond count. This is Kafka’s unit for every configured
timeout, interval, and retention window.
Source§fn from_micros(micros: i64) -> Self
fn from_micros(micros: i64) -> Self
A raw microsecond count.
Source§fn from_nanos(nanos: i64) -> Self
fn from_nanos(nanos: i64) -> Self
A raw nanosecond count, for measured latencies.
Source§fn from_secs_f64(secs: f64) -> Self
fn from_secs_f64(secs: f64) -> Self
A fractional second count.
Source§fn millis_i32(self) -> i32
fn millis_i32(self) -> i32
The extent as Kafka’s
int32 millisecond fields (session_timeout_ms).Source§fn millis_i64(self) -> i64
fn millis_i64(self) -> i64
The extent as Kafka’s
int64 millisecond fields (retention_ms).Source§fn millis_i64_trunc(self) -> i64
fn millis_i64_trunc(self) -> i64
The extent in whole milliseconds, truncated toward zero. Read more
Source§fn micros_i64(self) -> i64
fn micros_i64(self) -> i64
The extent in microseconds.