aboutsummaryrefslogtreecommitdiff
path: root/embassy-time/src/timer.rs
diff options
context:
space:
mode:
authorRalph Ursprung <[email protected]>2025-07-28 15:37:34 +0200
committerRalph Ursprung <[email protected]>2025-07-28 15:44:21 +0200
commit98595f659c309703aab411b6b3be7579b6e93c5d (patch)
treec2c138d3d0e2e1348b66ee31dae9b2f772d801d1 /embassy-time/src/timer.rs
parent8f64a14bebe711962af0136a5acd2b3cef509402 (diff)
`embassy-time`: add missing `Debug` & `defmt::Format` derives
`defmt::Format` is *not* implemented for `MockDriver` and `InnerMockDriver` because the former contains the latter and the latter is using `Queue` from `embassy-time-queue-utils` which so far does not have a `defmt` dependency. since this is just a mock driver it shouldn't be relevant if it has no `defmt::Format` impl.
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,