Skip to content

Commit 0ce30a0

Browse files
committed
Make Time public
If we make `Time` public, this allows for other libraries to implement the handling of time themselves. This could be nice for things like wasm where we can't use the standard library to get the time, but we sitll have access to the time through other libraries.
1 parent a24626b commit 0ce30a0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lightning/src/util/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub mod message_signing;
2121
pub mod invoice;
2222
pub mod persist;
2323
pub mod string;
24+
pub mod time;
2425
pub mod wakers;
2526

2627
pub(crate) mod atomic_counter;
@@ -35,7 +36,6 @@ pub(crate) mod poly1305;
3536
pub(crate) mod chacha20poly1305rfc;
3637
pub(crate) mod transaction_utils;
3738
pub(crate) mod scid_utils;
38-
pub(crate) mod time;
3939

4040
pub mod indexed_map;
4141

lightning/src/util/time.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ impl Sub<Duration> for Eternity {
6060

6161
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6262
#[cfg(not(feature = "no-std"))]
63+
/// Tracts time monotonically, but may go backwards in time if the system clock is adjusted.
6364
pub struct MonotonicTime(std::time::Instant);
6465

6566
/// The amount of time to shift `Instant` forward to prevent overflow when subtracting a `Duration`

0 commit comments

Comments
 (0)