refactor(client): encapsulate SignedDuration and enhance its API

Hide internal fields to improve type safety and provide helper methods for unit conversions and negative value checks. Fix several feature-gated test compilation issues.
This commit is contained in:
Nils Andreas Svee committed 2026-05-17 22:47:16 +07:00
1 parent bec56d4114
commit 2d6581f31f
12 files changed
+107 -77

No files matched your search

@@ -1,3 +1,4 @@
#[cfg(all(target_os = "linux", feature = "ancillary"))]
use super::*;
#[test]
@@ -18,8 +18,8 @@ fn server_processing_greater_than_raw_does_not_underflow() {
..Default::default()
},
);
assert_eq!(rtt.adjusted, Some(SignedDuration { ns: -999_999_999 }));
assert_eq!(rtt.effective, SignedDuration { ns: -999_999_999 });
assert_eq!(rtt.adjusted, Some(SignedDuration::from_nanos(-999_999_999)));
assert_eq!(rtt.effective, SignedDuration::from_nanos(-999_999_999));
}
#[test]