aboutsummaryrefslogtreecommitdiff
path: root/src/libs/intertrait/cast/error.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-07-28 20:36:53 +0200
committerHampusM <hampus@hampusmat.com>2022-07-31 12:17:51 +0200
commit545e8efddf217f300b26b930f8345d8573c30ec7 (patch)
tree41314bb8a452e70924aa007f11bea1f6338b3718 /src/libs/intertrait/cast/error.rs
parentf75a7d58135825c4f9094c1e10f36de4a952f455 (diff)
refactor: add Intertrait cast error
Diffstat (limited to 'src/libs/intertrait/cast/error.rs')
-rw-r--r--src/libs/intertrait/cast/error.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libs/intertrait/cast/error.rs b/src/libs/intertrait/cast/error.rs
new file mode 100644
index 0000000..e4211b1
--- /dev/null
+++ b/src/libs/intertrait/cast/error.rs
@@ -0,0 +1,17 @@
+use std::fmt;
+use std::fmt::{Display, Formatter};
+
+use error_stack::Context;
+
+#[derive(Debug)]
+pub struct CastError;
+
+impl Display for CastError
+{
+ fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result
+ {
+ fmt.write_str("Failed to cast between traits")
+ }
+}
+
+impl Context for CastError {}