[GH-ISSUE #1995] Use Duration and other Rust time formats in APIs #844

Open
opened 2026-03-16 00:31:41 +03:00 by kerem · 1 comment
Owner

Originally created by @bluejekyll on GitHub (Jul 30, 2023).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1995

The Record types currently use the RFC spec of u32 in APIs for TTL and other time based items. While the internal storage can remain u32 on the structs, it would be good to replace APIs with the std::time types instead to make the APIs more convenient.

Originally created by @bluejekyll on GitHub (Jul 30, 2023). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1995 The `Record` types currently use the RFC spec of `u32` in APIs for TTL and other time based items. While the internal storage can remain `u32` on the structs, it would be good to replace APIs with the `std::time` types instead to make the APIs more convenient.
Author
Owner

@djc commented on GitHub (Aug 29, 2023):

If the internal storage is u32 (and that is the intended range for the data), using a Duration for input values, since it makes it less clear what the valid range for the type is. On the other hand, using Duration for output values might still be nice.

<!-- gh-comment-id:1697169042 --> @djc commented on GitHub (Aug 29, 2023): If the internal storage is `u32` (and that is the intended range for the data), using a `Duration` for input values, since it makes it less clear what the valid range for the type is. On the other hand, using `Duration` for output values might still be nice.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#844
No description provided.