microde_application/error.rs
1use std::error::Error;
2use std::fmt::{self, Display, Formatter};
3
4/// An owned error that can cross the runtime's concurrency boundaries.
5#[derive(Debug, Clone, PartialEq, Eq)]
6pub struct MicrodeError {
7 message: String,
8}
9
10impl MicrodeError {
11 pub fn new(message: impl Into<String>) -> Self {
12 Self {
13 message: message.into(),
14 }
15 }
16}
17
18impl Display for MicrodeError {
19 fn fmt(&self, formatter: &mut Formatter<'_>) -> fmt::Result {
20 formatter.write_str(&self.message)
21 }
22}
23
24impl Error for MicrodeError {}