#[repr(i32)]pub enum TimeUnit {
Nanosecond = 0,
Microsecond = 1,
Millisecond = 2,
Second = 3,
Minute = 4,
Hour = 5,
Day = 6,
}
Expand description
Different resolutions supported by the time related metric types (e.g. DatetimeMetric).
Variants§
Nanosecond = 0
Truncate to nanosecond precision.
Microsecond = 1
Truncate to microsecond precision.
Millisecond = 2
Truncate to millisecond precision.
Second = 3
Truncate to second precision.
Minute = 4
Truncate to minute precision.
Hour = 5
Truncate to hour precision.
Day = 6
Truncate to day precision.
Implementations§
Source§impl 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§
Source§impl<UT> ConvertError<UT> for TimeUnit
impl<UT> ConvertError<UT> for TimeUnit
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
Source§impl<'de> Deserialize<'de> for TimeUnit
impl<'de> Deserialize<'de> for TimeUnit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<UT> FfiConverter<UT> for TimeUnit
impl<UT> FfiConverter<UT> for TimeUnit
Source§const TYPE_ID_META: MetadataBuffer
const TYPE_ID_META: MetadataBuffer
Type ID metadata, serialized into a MetadataBuffer.
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
The low-level type used for passing values of this type over the FFI. Read more
Source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
Lower a rust value of the target type, into an FFI value of type Self::FfiType. Read more
Source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
Lift a rust value of the target type, from an FFI value of type Self::FfiType. Read more
Source§impl<UT> LiftReturn<UT> for TimeUnit
impl<UT> LiftReturn<UT> for TimeUnit
Source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
Lift a successfully returned value from a trait interface
Source§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
Lift a foreign returned value from a trait interface Read more
Source§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
Lift a Rust value for a callback interface method error result Read more
Source§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Lift a Rust value for an unexpected callback interface error Read more
Source§impl<UT> LowerError<UT> for TimeUnit
impl<UT> LowerError<UT> for TimeUnit
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for TimeUnit
impl<UT> LowerReturn<UT> for TimeUnit
Source§type ReturnType = <TimeUnit as Lower<UT>>::FfiType
type ReturnType = <TimeUnit as Lower<UT>>::FfiType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
Source§impl MallocSizeOf for TimeUnit
impl MallocSizeOf for TimeUnit
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Source§impl TryFrom<i32> for TimeUnit
Trait implementation for converting an integer value to a 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 Eq for TimeUnit
impl StructuralPartialEq for TimeUnit
Auto Trait Implementations§
impl Freeze for TimeUnit
impl RefUnwindSafe for TimeUnit
impl Send for TimeUnit
impl Sync for TimeUnit
impl Unpin for TimeUnit
impl UnwindSafe for TimeUnit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EncodableKey for Twhere
T: Serialize,
impl<T> EncodableKey for Twhere
T: Serialize,
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§impl<V> ObjectSerialize for Vwhere
V: Serialize + for<'de> Deserialize<'de>,
impl<V> ObjectSerialize for Vwhere
V: Serialize + for<'de> Deserialize<'de>,
Source§fn from_str(obj: &str) -> Result<V, ObjectError>
fn from_str(obj: &str) -> Result<V, ObjectError>
Deserialize the object from its JSON representation. Read more
Source§fn into_serialized_object(self) -> Result<Value, ObjectError>
fn into_serialized_object(self) -> Result<Value, ObjectError>
Serialize this object into a JSON string.