diff options
| author | wackazong <[email protected]> | 2024-12-23 08:18:18 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-12-23 08:18:18 +0100 |
| commit | 4c7e1b05a0f363e6a3905e1d2743ff420adf9d4c (patch) | |
| tree | 1897559f83ea6fc54f0e3f31860b00237b7b3060 /embassy-executor | |
| parent | bb8ad9148a2fbbe56b3dc2293cd852a444a14203 (diff) | |
Impl core::err::Error for SpawnError
Diffstat (limited to 'embassy-executor')
| -rw-r--r-- | embassy-executor/src/spawner.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/embassy-executor/src/spawner.rs b/embassy-executor/src/spawner.rs index 16347ad71..41320d4c3 100644 --- a/embassy-executor/src/spawner.rs +++ b/embassy-executor/src/spawner.rs | |||
| @@ -62,6 +62,16 @@ pub enum SpawnError { | |||
| 62 | Busy, | 62 | Busy, |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | impl core::fmt::Display for SpawnError { | ||
| 66 | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { | ||
| 67 | match self { | ||
| 68 | SpawnError::Busy => write!(f, "Busy"), | ||
| 69 | } | ||
| 70 | } | ||
| 71 | } | ||
| 72 | |||
| 73 | impl core::error::Error for SpawnError {} | ||
| 74 | |||
| 65 | /// Handle to spawn tasks into an executor. | 75 | /// Handle to spawn tasks into an executor. |
| 66 | /// | 76 | /// |
| 67 | /// This Spawner can spawn any task (Send and non-Send ones), but it can | 77 | /// This Spawner can spawn any task (Send and non-Send ones), but it can |
