struct_map/
error.rs

1use std::error::Error;
2use std::fmt;
3
4#[derive(Debug)]
5pub struct StructMapError(String);
6
7impl StructMapError {
8    pub fn new<S: Into<String>>(content: S) -> Self {
9        StructMapError(content.into())
10    }
11}
12
13impl fmt::Display for StructMapError {
14    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
15        write!(f, "structmap error: {}", self.0)
16    }
17}
18
19impl Error for StructMapError {}