Skip to main content

Time

Type Alias Time 

Source
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: f64

Quantity value stored in the base units for the quantity.

Trait Implementations§

Source§

impl Human for Time

Source§

type Rendered = HumanTime

The Display adapter this quantity renders through.
Source§

fn human(self) -> Self::Rendered

This quantity, ready to print.
Source§

impl TimeExt for Time

Source§

const ZERO: Self

No elapsed time.
Source§

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

A raw microsecond count.
Source§

fn from_nanos(nanos: i64) -> Self

A raw nanosecond count, for measured latencies.
Source§

fn from_secs(secs: i64) -> Self

A raw second count.
Source§

fn from_secs_f64(secs: f64) -> Self

A fractional second count.
Source§

fn from_std(duration: Duration) -> Self

A Duration, which is the unit tokio, std, and qubit-clock use.
Source§

fn millis_i32(self) -> i32

The extent as Kafka’s int32 millisecond fields (session_timeout_ms).
Source§

fn millis_i64(self) -> i64

The extent as Kafka’s int64 millisecond fields (retention_ms).
Source§

fn millis_i64_trunc(self) -> i64

The extent in whole milliseconds, truncated toward zero. Read more
Source§

fn micros_i64(self) -> i64

The extent in microseconds.
Source§

fn nanos_i64(self) -> i64

The extent in nanoseconds.
Source§

fn secs_i64(self) -> i64

The extent in whole seconds, rounded to nearest.
Source§

fn secs_f64(self) -> f64

The extent in fractional seconds, for metrics histograms.
Source§

fn to_std(self) -> Duration

The extent as a Duration, for tokio::time::sleep and friends. Read more