device-envoy-core 0.0.6-alpha.0

Shared traits and data types for device-envoy platform crates
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Shared error and result types for `device-envoy-core`.

/// A specialized `Result` where the error is this crate's [`Error`] type.
pub type Result<T, E = Error> = core::result::Result<T, E>;

/// Unified error type for `device-envoy-core`.
#[derive(Debug)]
#[non_exhaustive]
pub enum Error {
    /// Spawning an Embassy task failed.
    TaskSpawn(embassy_executor::SpawnError),
}

impl From<embassy_executor::SpawnError> for Error {
    fn from(err: embassy_executor::SpawnError) -> Self {
        Self::TaskSpawn(err)
    }
}