Expand description
The time
module focuses on implementing various time-related features and utilities.
It provides a generic Timestamp
along with supporting traits and types to facilitate
time management.
Additionally, the crate defines several key traits to support time functionalities:
RawTimestamp
- A marker trait denoting compatible raw timestamp typesNow
- A trait for obtaining the current time
Modules§
- epoch
- error
- the
error
module provides a custom error type for thetime
crate as well as a type alias for results using this error type. - timestamp
- traits
- this moodule implements the core traits supporting the
time
module - utils
- time-related utilities
Structs§
- Epoch
- An
Epoch
represents a span of time defined by a startingTimestamp
and a size in units of time (e.g., seconds, minutes, hours). The size indicates the duration of the epoch and is used to determine when the epoch ends. - Timestamp
Timestamp
is a generic implementation of a type that represents some point in time.
Enums§
Traits§
- Now
- The
Now
trait provides a common creation routines for all datetime implementations. - RawTimestamp
- A marker trait indicating types capable of representing a raw timestamp value.
- Timestamp
Repr - The
TimestampRepr
trait provides a way of associating a raw timestamp type with its corresponding value type.
Functions§
- std_
time - the
std_time
function returns the current system time in milliseconds as anu128
. - systime
- the
systime
function returns the current system timestamp as aDuration
allowing users to convert the object into their desired units.