aboutsummaryrefslogtreecommitdiff
path: root/embassy-time/src/timer.rs
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2025-07-28 14:21:55 +0000
committerDario Nieuwenhuis <[email protected]>2025-07-29 00:36:22 +0200
commit19e026717d7513c19668ae03d1fd36cfcd865222 (patch)
tree11e88596c9e021040700e9e4212ed45e4c799c91 /embassy-time/src/timer.rs
parent8f64a14bebe711962af0136a5acd2b3cef509402 (diff)
parent98595f659c309703aab411b6b3be7579b6e93c5d (diff)
Merge pull request #4476 from rursprung/impl-Debug-for-Delay
`embassy-time`: add missing `Debug` & `defmt::Format` derives
Diffstat (limited to 'embassy-time/src/timer.rs')
-rw-r--r--embassy-time/src/timer.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/embassy-time/src/timer.rs b/embassy-time/src/timer.rs
index d3f1e1621..54bb9b6d8 100644
--- a/embassy-time/src/timer.rs
+++ b/embassy-time/src/timer.rs
@@ -66,6 +66,8 @@ impl<F: Future> WithTimeout for F {
66 66
67/// Future for the [`with_timeout`] and [`with_deadline`] functions. 67/// Future for the [`with_timeout`] and [`with_deadline`] functions.
68#[must_use = "futures do nothing unless you `.await` or poll them"] 68#[must_use = "futures do nothing unless you `.await` or poll them"]
69#[derive(Debug)]
70#[cfg_attr(feature = "defmt", derive(defmt::Format))]
69pub struct TimeoutFuture<F> { 71pub struct TimeoutFuture<F> {
70 timer: Timer, 72 timer: Timer,
71 fut: F, 73 fut: F,
@@ -92,6 +94,8 @@ impl<F: Future> Future for TimeoutFuture<F> {
92 94
93/// A future that completes at a specified [Instant](struct.Instant.html). 95/// A future that completes at a specified [Instant](struct.Instant.html).
94#[must_use = "futures do nothing unless you `.await` or poll them"] 96#[must_use = "futures do nothing unless you `.await` or poll them"]
97#[derive(Debug)]
98#[cfg_attr(feature = "defmt", derive(defmt::Format))]
95pub struct Timer { 99pub struct Timer {
96 expires_at: Instant, 100 expires_at: Instant,
97 yielded_once: bool, 101 yielded_once: bool,
@@ -227,6 +231,8 @@ impl Future for Timer {
227/// ## Cancel safety 231/// ## Cancel safety
228/// It is safe to cancel waiting for the next tick, 232/// It is safe to cancel waiting for the next tick,
229/// meaning no tick is lost if the Future is dropped. 233/// meaning no tick is lost if the Future is dropped.
234#[derive(Debug)]
235#[cfg_attr(feature = "defmt", derive(defmt::Format))]
230pub struct Ticker { 236pub struct Ticker {
231 expires_at: Instant, 237 expires_at: Instant,
232 duration: Duration, 238 duration: Duration,