| 1 | 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/; |
| 2 | |
| 3 | /// Convenience alias for the `udev` library `Result` type. |
| 4 | pub type Resultrust-analyzer cargo udevrs 0.4.0 error/Result#<T> = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<T, Errorrust-analyzer cargo udevrs 0.4.0 error/Error#>; |
| 5 | |
| 6 | /// Error types for the `udev` library. |
| 7 | #[repr(C)] |
| 8 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 9 | pub enum Errorrust-analyzer cargo udevrs 0.4.0 error/Error# { |
| 10 | InvalidLenrust-analyzer cargo udevrs 0.4.0 error/Error#InvalidLen#(usize), |
| 11 | Udevrust-analyzer cargo udevrs 0.4.0 error/Error#Udev#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 12 | UdevDevicerust-analyzer cargo udevrs 0.4.0 error/Error#UdevDevice#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 13 | UdevHwdbrust-analyzer cargo udevrs 0.4.0 error/Error#UdevHwdb#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 14 | UdevMonitorrust-analyzer cargo udevrs 0.4.0 error/Error#UdevMonitor#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 15 | UdevEnumeraterust-analyzer cargo udevrs 0.4.0 error/Error#UdevEnumerate#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 16 | UdevQueuerust-analyzer cargo udevrs 0.4.0 error/Error#UdevQueue#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 17 | UdevUtilrust-analyzer cargo udevrs 0.4.0 error/Error#UdevUtil#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 18 | Iorust-analyzer cargo udevrs 0.4.0 error/Error#Io#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 19 | } |
| 20 | |
| 21 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/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/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#> for Errorrust-analyzer cargo udevrs 0.4.0 error/Error# { |
| 22 | fn fromrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][`From<std::io::Error>`]from().(err: 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#) -> Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][`From<std::io::Error>`] { |
| 23 | Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][`From<std::io::Error>`]::Iorust-analyzer cargo udevrs 0.4.0 error/Error#Io#(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{err}")) |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::arrayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/::TryFromSliceErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/TryFromSliceError#> for Errorrust-analyzer cargo udevrs 0.4.0 error/Error# { |
| 28 | fn fromrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][`From<std::array::TryFromSliceError>`]from().(err: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::arrayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/::TryFromSliceErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/TryFromSliceError#) -> Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][`From<std::array::TryFromSliceError>`] { |
| 29 | Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][`From<std::array::TryFromSliceError>`]::Iorust-analyzer cargo udevrs 0.4.0 error/Error#Io#(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{err}")) |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<globrust-analyzer cargo glob 0.3.2 crate/::PatternErrorrust-analyzer cargo glob 0.3.2 PatternError#> for Errorrust-analyzer cargo udevrs 0.4.0 error/Error# { |
| 34 | fn fromrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][`From<glob::PatternError>`]from().(err: globrust-analyzer cargo glob 0.3.2 crate/::PatternErrorrust-analyzer cargo glob 0.3.2 PatternError#) -> Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][`From<glob::PatternError>`] { |
| 35 | Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][`From<glob::PatternError>`]::Iorust-analyzer cargo udevrs 0.4.0 error/Error#Io#(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("invalid glob pattern: {err}")) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<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#> for Errorrust-analyzer cargo udevrs 0.4.0 error/Error# { |
| 40 | fn fromrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][`From<std::ffi::NulError>`]from().(err: 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#) -> Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][`From<std::ffi::NulError>`] { |
| 41 | Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][`From<std::ffi::NulError>`]::Iorust-analyzer cargo udevrs 0.4.0 error/Error#Io#(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("invalid FFI C-String: {err}")) |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | impl 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 udevrs 0.4.0 error/Error# { |
| 46 | fn fmtrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][Display]fmt().(&self, f: &mut 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#<'_>) -> 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# { |
| 47 | match self { |
| 48 | Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][Display]::InvalidLenrust-analyzer cargo udevrs 0.4.0 error/Error#InvalidLen#(err) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "udev invalid length: {err}"), |
| 49 | Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][Display]::Udevrust-analyzer cargo udevrs 0.4.0 error/Error#Udev#(err) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "udev: {err}"), |
| 50 | Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][Display]::UdevDevicerust-analyzer cargo udevrs 0.4.0 error/Error#UdevDevice#(err) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "udev device: {err}"), |
| 51 | Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][Display]::UdevHwdbrust-analyzer cargo udevrs 0.4.0 error/Error#UdevHwdb#(err) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "udev hwdb: {err}"), |
| 52 | Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][Display]::UdevMonitorrust-analyzer cargo udevrs 0.4.0 error/Error#UdevMonitor#(err) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "udev monitor: {err}"), |
| 53 | Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][Display]::UdevEnumeraterust-analyzer cargo udevrs 0.4.0 error/Error#UdevEnumerate#(err) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "udev enumerate: {err}"), |
| 54 | Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][Display]::UdevQueuerust-analyzer cargo udevrs 0.4.0 error/Error#UdevQueue#(err) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "udev queue: {err}"), |
| 55 | Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][Display]::UdevUtilrust-analyzer cargo udevrs 0.4.0 error/Error#UdevUtil#(err) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "udev util: {err}"), |
| 56 | Selfrust-analyzer cargo udevrs 0.4.0 error/impl#[Error][Display]::Iorust-analyzer cargo udevrs 0.4.0 error/Error#Io#(err) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "I/O: {err}"), |
| 57 | } |
| 58 | } |
| 59 | } |