From 1c46b68581213ca8ae6200daa32f626b5389b4b0 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 25 Aug 2022 20:21:49 +0200 Subject: 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 --- src/errors/ptr.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/errors/ptr.rs (limited to 'src/errors/ptr.rs') 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, + }, +} -- cgit v1.2.3-18-g5258