veecle_osal_api/
error.rs

1/// A result with the [`Error`] error.
2pub type Result<T> = core::result::Result<T, Error>;
3
4/// An error that may happen during Veecle OS operations.
5#[derive(Debug)]
6pub enum Error {
7    /// Run out of memory during the action.
8    OutOfMemory,
9    /// Could not apply the operation due to unknown error.
10    Unknown,
11}
12
13impl core::error::Error for Error {}
14
15impl core::fmt::Display for Error {
16    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
17        match self {
18            Error::OutOfMemory => write!(f, "out of memory"),
19            Error::Unknown => write!(f, "unknown error"),
20        }
21    }
22}