Skip to content

Redesign TimeVal and TimeSpec #277

Closed
@kamalmarhubi

Description

@kamalmarhubi

(TimeSpec is being added in #276)

These types aim to provide a nice Rust struct abstraction over the libc types. However, they could be revisited. Some issues I noticed:

  • all the ops trait impls lose range on the values by calling num_microseconds() (num_nanoseconds()) for implementation convenience. This reduces the usable range of TimeVal to +/- ~300k years (probably ok) and TimeSpec to +/- ~300 years (not really ok).
  • std::Duration has been stable since 1.3.0, and we should provide interconversions, and probably deprecate all the hours() and such methods in favour of converting from a Duration. (This brings up version support policy Decide on a rust version support policy #238.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions