| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ffirust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/::{CStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_str/CStr#, CStringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/CString#}; |
| 2 | |
| 3 | /// A `dlerror` error. |
| 4 | pub struct DlDescriptionrust-analyzer cargo libloading 0.8.9 error/DlDescription#(pub(craterust-analyzer cargo libloading 0.8.9 crate/) CStringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/CString#); |
| 5 | |
| 6 | impl 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# for DlDescriptionrust-analyzer cargo libloading 0.8.9 error/DlDescription# { |
| 7 | fn fmtrust-analyzer cargo libloading 0.8.9 error/impl#[DlDescription][Debug]fmt().(&self, f: &mut 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/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> 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/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 8 | 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#::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/impl#[CString][Debug]fmt().(&self.0rust-analyzer cargo libloading 0.8.9 error/DlDescription#0., f) |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<&CStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_str/CStr#> for DlDescriptionrust-analyzer cargo libloading 0.8.9 error/DlDescription# { |
| 13 | fn fromrust-analyzer cargo libloading 0.8.9 error/impl#[DlDescription][`From<&CStr>`]from().(value: &CStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_str/CStr#) -> Selfrust-analyzer cargo libloading 0.8.9 error/impl#[DlDescription][`From<&CStr>`] { |
| 14 | Selfrust-analyzer cargo libloading 0.8.9 error/impl#[DlDescription][`From<&CStr>`](value.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()) |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | /// A Windows API error. |
| 19 | pub struct WindowsErrorrust-analyzer cargo libloading 0.8.9 error/WindowsError#(pub(craterust-analyzer cargo libloading 0.8.9 crate/) 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#); |
| 20 | |
| 21 | impl 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# for WindowsErrorrust-analyzer cargo libloading 0.8.9 error/WindowsError# { |
| 22 | fn fmtrust-analyzer cargo libloading 0.8.9 error/impl#[WindowsError][Debug]fmt().(&self, f: &mut 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/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> 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/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 23 | 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#::fmtrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error][Debug]fmt().(&self.0rust-analyzer cargo libloading 0.8.9 error/WindowsError#0., f) |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | /// Errors. |
| 28 | #[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:)] |
| 29 | #[non_exhaustive] |
| 30 | pub enum Errorrust-analyzer cargo libloading 0.8.9 error/Error# { |
| 31 | /// The `dlopen` call failed. |
| 32 | DlOpenrust-analyzer cargo libloading 0.8.9 error/Error#DlOpen# { |
| 33 | /// The source error. |
| 34 | descrust-analyzer cargo libloading 0.8.9 error/Error#DlOpen#desc.: DlDescriptionrust-analyzer cargo libloading 0.8.9 error/DlDescription#, |
| 35 | }, |
| 36 | /// The `dlopen` call failed and system did not report an error. |
| 37 | DlOpenUnknownrust-analyzer cargo libloading 0.8.9 error/Error#DlOpenUnknown#, |
| 38 | /// The `dlsym` call failed. |
| 39 | DlSymrust-analyzer cargo libloading 0.8.9 error/Error#DlSym# { |
| 40 | /// The source error. |
| 41 | descrust-analyzer cargo libloading 0.8.9 error/Error#DlSym#desc.: DlDescriptionrust-analyzer cargo libloading 0.8.9 error/DlDescription#, |
| 42 | }, |
| 43 | /// The `dlsym` call failed and system did not report an error. |
| 44 | DlSymUnknownrust-analyzer cargo libloading 0.8.9 error/Error#DlSymUnknown#, |
| 45 | /// The `dlclose` call failed. |
| 46 | DlCloserust-analyzer cargo libloading 0.8.9 error/Error#DlClose# { |
| 47 | /// The source error. |
| 48 | descrust-analyzer cargo libloading 0.8.9 error/Error#DlClose#desc.: DlDescriptionrust-analyzer cargo libloading 0.8.9 error/DlDescription#, |
| 49 | }, |
| 50 | /// The `dlclose` call failed and system did not report an error. |
| 51 | DlCloseUnknownrust-analyzer cargo libloading 0.8.9 error/Error#DlCloseUnknown#, |
| 52 | /// The `LoadLibraryW` call failed. |
| 53 | LoadLibraryExWrust-analyzer cargo libloading 0.8.9 error/Error#LoadLibraryExW# { |
| 54 | /// The source error. |
| 55 | sourcerust-analyzer cargo libloading 0.8.9 error/Error#LoadLibraryExW#source.: WindowsErrorrust-analyzer cargo libloading 0.8.9 error/WindowsError#, |
| 56 | }, |
| 57 | /// The `LoadLibraryW` call failed and system did not report an error. |
| 58 | LoadLibraryExWUnknownrust-analyzer cargo libloading 0.8.9 error/Error#LoadLibraryExWUnknown#, |
| 59 | /// The `GetModuleHandleExW` call failed. |
| 60 | GetModuleHandleExWrust-analyzer cargo libloading 0.8.9 error/Error#GetModuleHandleExW# { |
| 61 | /// The source error. |
| 62 | sourcerust-analyzer cargo libloading 0.8.9 error/Error#GetModuleHandleExW#source.: WindowsErrorrust-analyzer cargo libloading 0.8.9 error/WindowsError#, |
| 63 | }, |
| 64 | /// The `GetModuleHandleExW` call failed and system did not report an error. |
| 65 | GetModuleHandleExWUnknownrust-analyzer cargo libloading 0.8.9 error/Error#GetModuleHandleExWUnknown#, |
| 66 | /// The `GetProcAddress` call failed. |
| 67 | GetProcAddressrust-analyzer cargo libloading 0.8.9 error/Error#GetProcAddress# { |
| 68 | /// The source error. |
| 69 | sourcerust-analyzer cargo libloading 0.8.9 error/Error#GetProcAddress#source.: WindowsErrorrust-analyzer cargo libloading 0.8.9 error/WindowsError#, |
| 70 | }, |
| 71 | /// The `GetProcAddressUnknown` call failed and system did not report an error. |
| 72 | GetProcAddressUnknownrust-analyzer cargo libloading 0.8.9 error/Error#GetProcAddressUnknown#, |
| 73 | /// The `FreeLibrary` call failed. |
| 74 | FreeLibraryrust-analyzer cargo libloading 0.8.9 error/Error#FreeLibrary# { |
| 75 | /// The source error. |
| 76 | sourcerust-analyzer cargo libloading 0.8.9 error/Error#FreeLibrary#source.: WindowsErrorrust-analyzer cargo libloading 0.8.9 error/WindowsError#, |
| 77 | }, |
| 78 | /// The `FreeLibrary` call failed and system did not report an error. |
| 79 | FreeLibraryUnknownrust-analyzer cargo libloading 0.8.9 error/Error#FreeLibraryUnknown#, |
| 80 | /// The requested type cannot possibly work. |
| 81 | IncompatibleSizerust-analyzer cargo libloading 0.8.9 error/Error#IncompatibleSize#, |
| 82 | /// Could not create a new CString. |
| 83 | CreateCStringrust-analyzer cargo libloading 0.8.9 error/Error#CreateCString# { |
| 84 | /// The source error. |
| 85 | sourcerust-analyzer cargo libloading 0.8.9 error/Error#CreateCString#source.: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ffirust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/::NulErrorrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/NulError#, |
| 86 | }, |
| 87 | /// Could not create a new CString from bytes with trailing null. |
| 88 | CreateCStringWithTrailingrust-analyzer cargo libloading 0.8.9 error/Error#CreateCStringWithTrailing# { |
| 89 | /// The source error. |
| 90 | sourcerust-analyzer cargo libloading 0.8.9 error/Error#CreateCStringWithTrailing#source.: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ffirust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/::FromBytesWithNulErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_str/FromBytesWithNulError#, |
| 91 | }, |
| 92 | } |
| 93 | |
| 94 | impl 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# for Errorrust-analyzer cargo libloading 0.8.9 error/Error# { |
| 95 | fn sourcerust-analyzer cargo libloading 0.8.9 error/impl#[Error][Error]source().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&(dyn 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# + 'static)> { |
| 96 | use Errorrust-analyzer cargo libloading 0.8.9 error/Error#::*; |
| 97 | match *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self { |
| 98 | CreateCStringrust-analyzer cargo libloading 0.8.9 error/Error#CreateCString# { ref sourcerust-analyzer cargo libloading 0.8.9 error/Error#CreateCString#source. } => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(source), |
| 99 | CreateCStringWithTrailingrust-analyzer cargo libloading 0.8.9 error/Error#CreateCStringWithTrailing# { ref sourcerust-analyzer cargo libloading 0.8.9 error/Error#CreateCStringWithTrailing#source. } => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(source), |
| 100 | LoadLibraryExWrust-analyzer cargo libloading 0.8.9 error/Error#LoadLibraryExW# { ref sourcerust-analyzer cargo libloading 0.8.9 error/Error#LoadLibraryExW#source. } => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&source.0rust-analyzer cargo libloading 0.8.9 error/WindowsError#0.), |
| 101 | GetModuleHandleExWrust-analyzer cargo libloading 0.8.9 error/Error#GetModuleHandleExW# { ref sourcerust-analyzer cargo libloading 0.8.9 error/Error#GetModuleHandleExW#source. } => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&source.0rust-analyzer cargo libloading 0.8.9 error/WindowsError#0.), |
| 102 | GetProcAddressrust-analyzer cargo libloading 0.8.9 error/Error#GetProcAddress# { ref sourcerust-analyzer cargo libloading 0.8.9 error/Error#GetProcAddress#source. } => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&source.0rust-analyzer cargo libloading 0.8.9 error/WindowsError#0.), |
| 103 | FreeLibraryrust-analyzer cargo libloading 0.8.9 error/Error#FreeLibrary# { ref sourcerust-analyzer cargo libloading 0.8.9 error/Error#FreeLibrary#source. } => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&source.0rust-analyzer cargo libloading 0.8.9 error/WindowsError#0.), |
| 104 | _ => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | impl 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/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Errorrust-analyzer cargo libloading 0.8.9 error/Error# { |
| 110 | fn fmtrust-analyzer cargo libloading 0.8.9 error/impl#[Error][Display]fmt().(&self, f: &mut 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/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> 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/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 111 | use Errorrust-analyzer cargo libloading 0.8.9 error/Error#::*; |
| 112 | match *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self { |
| 113 | DlOpenrust-analyzer cargo libloading 0.8.9 error/Error#DlOpen# { ref descrust-analyzer cargo libloading 0.8.9 error/Error#DlOpen#desc. } => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", desc.0rust-analyzer cargo libloading 0.8.9 error/DlDescription#0..to_string_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/impl#[CStr]to_string_lossy().()), |
| 114 | DlOpenUnknownrust-analyzer cargo libloading 0.8.9 error/Error#DlOpenUnknown# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "dlopen failed, but system did not report the error"), |
| 115 | DlSymrust-analyzer cargo libloading 0.8.9 error/Error#DlSym# { ref descrust-analyzer cargo libloading 0.8.9 error/Error#DlSym#desc. } => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", desc.0rust-analyzer cargo libloading 0.8.9 error/DlDescription#0..to_string_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/impl#[CStr]to_string_lossy().()), |
| 116 | DlSymUnknownrust-analyzer cargo libloading 0.8.9 error/Error#DlSymUnknown# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "dlsym failed, but system did not report the error"), |
| 117 | DlCloserust-analyzer cargo libloading 0.8.9 error/Error#DlClose# { ref descrust-analyzer cargo libloading 0.8.9 error/Error#DlClose#desc. } => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", desc.0rust-analyzer cargo libloading 0.8.9 error/DlDescription#0..to_string_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/impl#[CStr]to_string_lossy().()), |
| 118 | DlCloseUnknownrust-analyzer cargo libloading 0.8.9 error/Error#DlCloseUnknown# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "dlclose failed, but system did not report the error"), |
| 119 | LoadLibraryExWrust-analyzer cargo libloading 0.8.9 error/Error#LoadLibraryExW# { .. } => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "LoadLibraryExW failed"), |
| 120 | LoadLibraryExWUnknownrust-analyzer cargo libloading 0.8.9 error/Error#LoadLibraryExWUnknown# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!( |
| 121 | f, |
| 122 | "LoadLibraryExW failed, but system did not report the error" |
| 123 | ), |
| 124 | GetModuleHandleExWrust-analyzer cargo libloading 0.8.9 error/Error#GetModuleHandleExW# { .. } => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "GetModuleHandleExW failed"), |
| 125 | GetModuleHandleExWUnknownrust-analyzer cargo libloading 0.8.9 error/Error#GetModuleHandleExWUnknown# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!( |
| 126 | f, |
| 127 | "GetModuleHandleExWUnknown failed, but system did not report the error" |
| 128 | ), |
| 129 | GetProcAddressrust-analyzer cargo libloading 0.8.9 error/Error#GetProcAddress# { .. } => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "GetProcAddress failed"), |
| 130 | GetProcAddressUnknownrust-analyzer cargo libloading 0.8.9 error/Error#GetProcAddressUnknown# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!( |
| 131 | f, |
| 132 | "GetProcAddress failed, but system did not report the error" |
| 133 | ), |
| 134 | FreeLibraryrust-analyzer cargo libloading 0.8.9 error/Error#FreeLibrary# { .. } => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "FreeLibrary failed"), |
| 135 | FreeLibraryUnknownrust-analyzer cargo libloading 0.8.9 error/Error#FreeLibraryUnknown# => { |
| 136 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "FreeLibrary failed, but system did not report the error") |
| 137 | } |
| 138 | CreateCStringrust-analyzer cargo libloading 0.8.9 error/Error#CreateCString# { .. } => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "could not create a C string from bytes"), |
| 139 | CreateCStringWithTrailingrust-analyzer cargo libloading 0.8.9 error/Error#CreateCStringWithTrailing# { .. } => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!( |
| 140 | f, |
| 141 | "could not create a C string from bytes with trailing null" |
| 142 | ), |
| 143 | IncompatibleSizerust-analyzer cargo libloading 0.8.9 error/Error#IncompatibleSize# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "requested type cannot possibly work"), |
| 144 | } |
| 145 | } |
| 146 | } |