Crate time

Crate time 

Source
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 types
  • Now - A trait for obtaining the current time

Modules§

epoch
error
the error module provides a custom error type for the time 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 starting Timestamp 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§

Error

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.
TimestampRepr
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 an u128.
systime
the systime function returns the current system timestamp as a Duration allowing users to convert the object into their desired units.

Type Aliases§

Result
A type alias for a Result with the error type set to Error.