blackbox_cast/error.rs
1#[derive(Debug)]
2pub struct Error {
3 msg: String,
4}
5
6impl Error {
7 pub fn new<'a>(msg: &'a str) -> Self {
8 Self {
9 msg: String::from(msg),
10 }
11 }
12}
13
14impl std::fmt::Display for Error {
15 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16 write!(f, "TraitCastingError: {}", &self.msg.as_str())
17 }
18}