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
errormodule provides a custom error type for thetimecrate as well as a type alias for results using this error type. - timestamp
- traits
- this moodule implements the core traits supporting the
timemodule - utils
- time-related utilities
Structs§
- Epoch
- An
Epochrepresents a span of time defined by a startingTimestampand 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
Timestampis a generic implementation of a type that represents some point in time.
Enums§
Traits§
- Now
- The
Nowtrait 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
TimestampReprtrait provides a way of associating a raw timestamp type with its corresponding value type.
Functions§
- std_
time - the
std_timefunction returns the current system time in milliseconds as anu128. - systime
- the
systimefunction returns the current system timestamp as aDurationallowing users to convert the object into their desired units.