-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seeking feedback before release #1
Comments
This looks nice! I will try to have a look tomorrow :) |
Thanks, be sure to check the newest commit, I have made quite a few changes over the WE... After being on the fence for a long time, I have finally decided to return errors rather than options except for the |
I really like what you did with the new If more returnvalues are added in the future, maybe it might be a good idea to already use an What do you think about adding What do you think about adding impl<const EPOCH_REF: i64> Add<Duration> for &TaiTime<EPOCH_REF> {
type Output = TaiTime<EPOCH_REF>;
fn add(self, other: Duration) -> Self::Output {
*self + other
}
} This just add a little bit of ergonomics to use common operations with just references. This library could be used on smaller systems now, so it might be useful to add a CI test, it is really easy to forget some feature flag when adding new features during development, and not checking the I have not really used the library yet, so maybe I will only find some issue once I use it. I don't know what your plans for the release were, but it might be useful to use this library a bit on a pre-v1 version before comitting to a stable 1.0 release. |
Yes, About the Regarding |
Ohh thats right, You're right about the specific errors.. I am used to unify errors for high-level trait methods and for error propagation, but for such a low-level library this is probably the better way.. I might have a look at my own libraries to check whether error handling can be improved. |
Regarding The CI check for other target platforms is a good idea, I will add it. |
Closing this issue, v0.1.0 was just published, thanks for the feedback! We can still iron things out for a month or two while asynchronix 0.3.0 is still in the making. |
This crate is a slightly improved, epoch-independent version of the
MonotonicTime
timestamp from theasynchronix
crate v0.3.At the moment it also adds support for
no-std
,serde
and for thechrono
crate. Feature-gated support for other time-related crates (e.g.time
orhifitime
) and serialization crates (e.g.rkyv
) could be added later.But overall, the idea is to keep this crate lean and mean, so it does not intend to become much more than it is today. Also, since it is meant to become a public dependency of
asynchronix
and replace the currentMonotonicTime
, we will need to be fairly conservative regarding new additions and breaking changes once it is released.Any criticism welcome.
EDIT:
I am mostly happy with the design, but am a bit torn about error reporting. Rust's
std::time
is not itself fully consistent and returns mostlyNone
on out-of-range and overflow (all thechecked_*
methods) butSystemTime::duration_since
returns anError
in such case. I am not sure where to draw the line between what warrants anOption
and what warrants anError
.Even if an
Error
was returned from thefrom_*
andas_*
methods (or maybe these should betry_from_*
andtry_as_*
?), I would prefer to keep it simple and use a trivial type with no value. I find theDuration
field instd::time::SystemTimeError
to be slightly over-engineered, and given that overflow and out-of-range errors can occur in many ways inTaiTime
conversion methods, theDuration
field is probably not going to work for us.The text was updated successfully, but these errors were encountered: