Skip to content

Commit a049e29

Browse files
committed
Merge #83: Clock: Time Extent, Maker, and Associated Traits
e785a7f time extent: overhaul tests naming scheme (Cameron Garnham) 3d743ed time extent: use snake_case for module name (Cameron Garnham) 8653f9a time extent: rename `TimeExtentMaker` for clarity (Cameron Garnham) 0cab30c time extent: add tests and some corrections (Cameron Garnham) 028644d clock: time extent, maker, and associated traits (Cameron Garnham) Pull request description: `TimeExtent` is a simple structure that contains base increment (duration), and amount (a multiplier for the base the base increment). The resulting product of the base and the multiplier is the total duration of the time extent. `TimeExtentClock` is a helper that generates time extents based upon the increment length and the time of the clock, this clock is specialised according to the `test` predicate with the `DefaultClockExtentMaker` type. These modules will be used by the later connection cookie implementation. ACKs for top commit: da2ce7: ACK e785a7f Tree-SHA512: ba667cb47f9c5116355cbf34ea275d46404b09c5c1ff4aa825db2da49884a430174849b22c22a1b32b206bf06d7c34a054dc76b94a24e267205df909d0b3045d
2 parents 8da9963 + e785a7f commit a049e29

File tree

2 files changed

+558
-2
lines changed

2 files changed

+558
-2
lines changed

src/protocol/clock.rs renamed to src/protocol/clock/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::num::IntErrorKind;
2-
pub use std::time::Duration;
2+
use std::time::Duration;
33

44
pub type DurationSinceUnixEpoch = Duration;
55

@@ -240,9 +240,11 @@ mod stopped_clock {
240240

241241
#[test]
242242
fn it_should_get_app_start_time() {
243-
const TIME_AT_WRITING_THIS_TEST: Duration = Duration::new(1662983731, 000022312);
243+
const TIME_AT_WRITING_THIS_TEST: Duration = Duration::new(1662983731, 22312);
244244
assert!(get_app_start_time() > TIME_AT_WRITING_THIS_TEST);
245245
}
246246
}
247247
}
248248
}
249+
250+
pub mod time_extent;

0 commit comments

Comments
 (0)