diff options
| author | Ralph Ursprung <[email protected]> | 2025-07-28 15:37:34 +0200 |
|---|---|---|
| committer | Ralph Ursprung <[email protected]> | 2025-07-28 15:44:21 +0200 |
| commit | 98595f659c309703aab411b6b3be7579b6e93c5d (patch) | |
| tree | c2c138d3d0e2e1348b66ee31dae9b2f772d801d1 /embassy-time/src/timer.rs | |
| parent | 8f64a14bebe711962af0136a5acd2b3cef509402 (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.rs | 6 |
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))] | ||
| 69 | pub struct TimeoutFuture<F> { | 71 | pub 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))] | ||
| 95 | pub struct Timer { | 99 | pub 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))] | ||
| 230 | pub struct Ticker { | 236 | pub struct Ticker { |
| 231 | expires_at: Instant, | 237 | expires_at: Instant, |
| 232 | duration: Duration, | 238 | duration: Duration, |
