| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::anyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core any/::Anyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core any/Any#; |
| 2 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std error/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#; |
| 3 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::{Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#, Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#}; |
| 4 | |
| 5 | // Autoderef specialization similar to `clap::value_parser!()`. |
| 6 | pub struct SpecErrorWrapperrust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#<E>(pub E); |
| 7 | |
| 8 | pub trait SpecErrorrust-analyzer cargo sqlx 0.8.3 spec_error/SpecError#<E>: Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized# { |
| 9 | fn __sqlx_spec_errorrust-analyzer cargo sqlx 0.8.3 spec_error/SpecError#__sqlx_spec_error().( |
| 10 | &self, |
| 11 | ) -> fn(SpecErrorWrapperrust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#<E>) -> Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + 'static>; |
| 12 | } |
| 13 | |
| 14 | impl<E> SpecErrorrust-analyzer cargo sqlx 0.8.3 spec_error/SpecError#<E> for &&&&SpecErrorWrapperrust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#<E> |
| 15 | where |
| 16 | E: Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + 'static, |
| 17 | { |
| 18 | fn __sqlx_spec_errorrust-analyzer cargo sqlx 0.8.3 spec_error/impl#[`&&&&SpecErrorWrapper<E>`][`SpecError<E>`]__sqlx_spec_error().( |
| 19 | &self, |
| 20 | ) -> fn(SpecErrorWrapperrust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#<E>) -> Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + 'static> { |
| 21 | |e| Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(e.0rust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#0.) |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | impl<E> SpecErrorrust-analyzer cargo sqlx 0.8.3 spec_error/SpecError#<E> for &&&SpecErrorWrapperrust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#<E> |
| 26 | where |
| 27 | E: Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#, |
| 28 | { |
| 29 | fn __sqlx_spec_errorrust-analyzer cargo sqlx 0.8.3 spec_error/impl#[`&&&SpecErrorWrapper<E>`][`SpecError<E>`]__sqlx_spec_error().( |
| 30 | &self, |
| 31 | ) -> fn(SpecErrorWrapperrust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#<E>) -> Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + 'static> { |
| 32 | |e| e.0rust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#0..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | impl<E> SpecErrorrust-analyzer cargo sqlx 0.8.3 spec_error/SpecError#<E> for &&SpecErrorWrapperrust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#<E> |
| 37 | where |
| 38 | E: Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#, |
| 39 | { |
| 40 | fn __sqlx_spec_errorrust-analyzer cargo sqlx 0.8.3 spec_error/impl#[`&&SpecErrorWrapper<E>`][`SpecError<E>`]__sqlx_spec_error().( |
| 41 | &self, |
| 42 | ) -> fn(SpecErrorWrapperrust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#<E>) -> Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + 'static> { |
| 43 | |e| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:?}", e.0rust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#0.).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | impl<E> SpecErrorrust-analyzer cargo sqlx 0.8.3 spec_error/SpecError#<E> for &SpecErrorWrapperrust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#<E> |
| 48 | where |
| 49 | E: Anyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core any/Any#, |
| 50 | { |
| 51 | fn __sqlx_spec_errorrust-analyzer cargo sqlx 0.8.3 spec_error/impl#[`&SpecErrorWrapper<E>`][`SpecError<E>`]__sqlx_spec_error().( |
| 52 | &self, |
| 53 | ) -> fn(SpecErrorWrapperrust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#<E>) -> Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + 'static> { |
| 54 | |_e| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("unprintable error: {}", stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::anyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core any/::type_namerust-analyzer cargo core https://github.com/rust-lang/rust/library/core any/type_name().::<E>()).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | impl<E> SpecErrorrust-analyzer cargo sqlx 0.8.3 spec_error/SpecError#<E> for SpecErrorWrapperrust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#<E> { |
| 59 | fn __sqlx_spec_errorrust-analyzer cargo sqlx 0.8.3 spec_error/impl#[`SpecErrorWrapper<E>`][`SpecError<E>`]__sqlx_spec_error().( |
| 60 | &self, |
| 61 | ) -> fn(SpecErrorWrapperrust-analyzer cargo sqlx 0.8.3 spec_error/SpecErrorWrapper#<E>) -> Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + 'static> { |
| 62 | |_e| "unprintable error: (unprintable type)".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | #[doc(hidden)] |
| 67 | #[macro_export] |
| 68 | macro_rules! __spec_errorrust-analyzer cargo sqlx 0.8.3 spec_error/__spec_error! { |
| 69 | ($e:expr) => {{ |
| 70 | use $crate::spec_error::{SpecError, SpecErrorWrapper}; |
| 71 | |
| 72 | let wrapper = SpecErrorWrapper($e); |
| 73 | let wrap_err = wrapper.__sqlx_spec_error(); |
| 74 | wrap_err(wrapper) |
| 75 | }}; |
| 76 | } |
| 77 | |
| 78 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 79 | fn test_spec_errorrust-analyzer cargo sqlx 0.8.3 spec_error/test_spec_error().() { |
| 80 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 81 | struct DebugErrorrust-analyzer cargo sqlx 0.8.3 spec_error/DebugError#; |
| 82 | |
| 83 | struct AnyErrorrust-analyzer cargo sqlx 0.8.3 spec_error/AnyError#; |
| 84 | |
| 85 | let _e: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + 'static> = |
| 86 | __spec_errorrust-analyzer cargo sqlx 0.8.3 spec_error/__spec_error!!(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::fromrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error][`From<ErrorKind>`]from().(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::Unsupportedrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#Unsupported#)); |
| 87 | |
| 88 | let _e: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + 'static> = __spec_errorrust-analyzer cargo sqlx 0.8.3 spec_error/__spec_error!!("displayable error"); |
| 89 | |
| 90 | let _e: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + 'static> = __spec_errorrust-analyzer cargo sqlx 0.8.3 spec_error/__spec_error!!(DebugErrorrust-analyzer cargo sqlx 0.8.3 spec_error/DebugError#); |
| 91 | |
| 92 | let _e: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + 'static> = __spec_errorrust-analyzer cargo sqlx 0.8.3 spec_error/__spec_error!!(AnyErrorrust-analyzer cargo sqlx 0.8.3 spec_error/AnyError#); |
| 93 | |
| 94 | let _e: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + 'static> = __spec_errorrust-analyzer cargo sqlx 0.8.3 spec_error/__spec_error!!(&1i32); |
| 95 | } |