#[repr(i32)]
pub enum TimeUnit {
Nanosecond,
Microsecond,
Millisecond,
Second,
Minute,
Hour,
Day,
}
Expand description
Different resolutions supported by the time related metric types (e.g. DatetimeMetric).
Variants
Nanosecond
Truncate to nanosecond precision.
Microsecond
Truncate to microsecond precision.
Millisecond
Truncate to millisecond precision.
Second
Truncate to second precision.
Minute
Truncate to minute precision.
Hour
Truncate to hour precision.
Day
Truncate to day precision.
Implementations
sourceimpl TimeUnit
impl TimeUnit
sourcepub fn format_pattern(self) -> &'static str
pub fn format_pattern(self) -> &'static str
Formats the given time unit, truncating the time if needed.
sourcepub fn duration_convert(self, duration: Duration) -> u64
pub fn duration_convert(self, duration: Duration) -> u64
Trait Implementations
sourceimpl<'de> Deserialize<'de> for TimeUnit
impl<'de> Deserialize<'de> for TimeUnit
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<TimeUnit, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<TimeUnit, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for TimeUnit
impl Serialize for TimeUnit
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
sourceimpl TryFrom<i32> for TimeUnit
impl TryFrom<i32> for TimeUnit
Trait implementation for converting an integer value to a TimeUnit.
This is used in the FFI code.
Please note that values should match the ordering of the platform specific side of things (e.g. Kotlin implementation).
impl Copy for TimeUnit
impl StructuralPartialEq for TimeUnit
Auto Trait Implementations
impl RefUnwindSafe for TimeUnit
impl Send for TimeUnit
impl Sync for TimeUnit
impl Unpin for TimeUnit
impl UnwindSafe for TimeUnit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> EncodableKey for T where
T: Serialize,
impl<T> EncodableKey for T where
T: Serialize,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more