aboutsummaryrefslogtreecommitdiff
path: root/src/errors/ptr.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-08-25 20:21:49 +0200
committerHampusM <hampus@hampusmat.com>2022-08-27 14:28:23 +0200
commit1c46b68581213ca8ae6200daa32f626b5389b4b0 (patch)
tree8da649471db7893a2347a2df383324b84ac226f0 /src/errors/ptr.rs
parent8e862c7998d0b59c71d20cbcbbc57031f734b6fa (diff)
refactor!: make DI container have single get function
BREAKING CHANGE: The DI container get_singleton & get_factory functions have been replaced by the get function now returning a enum
Diffstat (limited to 'src/errors/ptr.rs')
-rw-r--r--src/errors/ptr.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/errors/ptr.rs b/src/errors/ptr.rs
new file mode 100644
index 0000000..e0c3d05
--- /dev/null
+++ b/src/errors/ptr.rs
@@ -0,0 +1,19 @@
+//! Smart pointer alias errors.
+
+/// Error type for [`SomePtr`].
+///
+/// [`SomePtr`]: crate::ptr::SomePtr
+#[derive(thiserror::Error, Debug)]
+pub enum SomePtrError
+{
+ /// Tried to get as a wrong smart pointer type.
+ #[error("Wrong smart pointer type. Expected {expected}, found {found}")]
+ WrongPtrType
+ {
+ /// The expected smart pointer type.
+ expected: &'static str,
+
+ /// The found smart pointer type.
+ found: &'static str,
+ },
+}