Enum glean::TimeUnit [−][src]
#[repr(i32)] pub enum TimeUnit { Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, Day, }
Different resolutions supported by the time related metric types (e.g. DatetimeMetric).
Variants
Truncate to nanosecond precision.
Truncate to microsecond precision.
Truncate to millisecond precision.
Truncate to second precision.
Truncate to minute precision.
Truncate to hour precision.
Truncate to day precision.
Implementations
impl TimeUnit
[src]
impl TimeUnit
[src]pub fn format_pattern(self) -> &'static str
[src]
Formats the given time unit, truncating the time if needed.
pub fn duration_convert(self, duration: Duration) -> u64
[src]
Converts a duration to the requested time unit.
Arguments
duration
- the duration to convert.
Returns
The integer representation of the converted duration.
pub fn as_nanos(self, duration: u64) -> u64
[src]
Trait Implementations
impl<'de> Deserialize<'de> for TimeUnit
[src]
impl<'de> Deserialize<'de> for TimeUnit
[src]pub fn deserialize<__D>(
__deserializer: __D
) -> Result<TimeUnit, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<TimeUnit, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl Serialize for TimeUnit
[src]
impl Serialize for TimeUnit
[src]pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl StructuralPartialEq for TimeUnit
[src]
impl StructuralPartialEq for TimeUnit
[src]Auto Trait Implementations
impl RefUnwindSafe for TimeUnit
impl RefUnwindSafe for TimeUnit
impl UnwindSafe for TimeUnit
impl UnwindSafe for TimeUnit
Blanket Implementations
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]impl<T> EncodableKey for T where
T: Serialize,
impl<T> EncodableKey for T where
T: Serialize,