diff options
author | HampusM <hampus@hampusmat.com> | 2022-11-19 15:45:12 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-11-19 15:45:12 +0100 |
commit | 9f27a925bd323e8e0864bedeb33a3c6953517ea1 (patch) | |
tree | ea5d8faaed82c58fa037fa377173bb365e1cd697 /src/private/cast/error.rs | |
parent | d99cbf9fa95856cbc14a3217e1cd3f13aeb2e0b3 (diff) |
refactor: reorganize non-public API items
Diffstat (limited to 'src/private/cast/error.rs')
-rw-r--r-- | src/private/cast/error.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/private/cast/error.rs b/src/private/cast/error.rs new file mode 100644 index 0000000..c6ed01d --- /dev/null +++ b/src/private/cast/error.rs @@ -0,0 +1,20 @@ +use crate::private::cast::{CasterError, GetCasterError}; + +#[derive(thiserror::Error, Debug)] +pub enum CastError +{ + #[error("Failed to get caster")] + GetCasterFailed(#[from] GetCasterError), + + #[error("Failed to cast from {from} to {to}")] + CastFailed + { + #[source] + source: CasterError, + from: &'static str, + to: &'static str, + }, + + #[error("'{0}' can't be cast to an Arc")] + NotArcCastable(&'static str), +} |