| 1 | 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#; |
| 2 | 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/; |
| 3 | |
| 4 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, 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:)] |
| 5 | pub enum ErrorKindrust-analyzer cargo privdrop 0.5.4 errors/ErrorKind# { |
| 6 | SysErrorrust-analyzer cargo privdrop 0.5.4 errors/ErrorKind#SysError#, |
| 7 | } |
| 8 | |
| 9 | #[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:)] |
| 10 | enum ErrorReprrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr# { |
| 11 | FromNixrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr#FromNix#(nixrust-analyzer cargo nix 0.31.3 crate/::Errorrust-analyzer cargo nix 0.31.3 Error#), |
| 12 | WithDescriptionrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr#WithDescription#(ErrorKindrust-analyzer cargo privdrop 0.5.4 errors/ErrorKind#, &'static str), |
| 13 | } |
| 14 | |
| 15 | #[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:)] |
| 16 | pub struct PrivDropErrorrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError# { |
| 17 | reprrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError#repr.: ErrorReprrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr#, |
| 18 | } |
| 19 | |
| 20 | impl Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# for PrivDropErrorrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError# { |
| 21 | fn causerust-analyzer cargo privdrop 0.5.4 errors/impl#[PrivDropError][Error]cause().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#> { |
| 22 | match self.reprrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError#repr. { |
| 23 | ErrorReprrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr#::FromNixrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr#FromNix#(ref e) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(e as &dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#), |
| 24 | _ => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 25 | } |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | 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 PrivDropErrorrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError# { |
| 30 | fn fmtrust-analyzer cargo privdrop 0.5.4 errors/impl#[PrivDropError][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#<'_>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#> { |
| 31 | match self.reprrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError#repr. { |
| 32 | ErrorReprrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr#::FromNixrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr#FromNix#(ref e) => e.fmtrust-analyzer cargo nix 0.31.3 errno/impl#[Errno][Display]fmt().(f), |
| 33 | ErrorReprrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr#::WithDescriptionrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr#WithDescription#(_, description) => description.fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[str][Display]fmt().(f), |
| 34 | } |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<nixrust-analyzer cargo nix 0.31.3 crate/::Errorrust-analyzer cargo nix 0.31.3 Error#> for PrivDropErrorrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError# { |
| 39 | fn fromrust-analyzer cargo privdrop 0.5.4 errors/impl#[PrivDropError][`From<nix::errno::Errno>`]from().(e: nixrust-analyzer cargo nix 0.31.3 crate/::Errorrust-analyzer cargo nix 0.31.3 Error#) -> PrivDropErrorrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError# { |
| 40 | PrivDropErrorrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError# { |
| 41 | reprrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError#repr.: ErrorReprrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr#::FromNixrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr#FromNix#(e), |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<(ErrorKindrust-analyzer cargo privdrop 0.5.4 errors/ErrorKind#, &'static str)> for PrivDropErrorrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError# { |
| 47 | fn fromrust-analyzer cargo privdrop 0.5.4 errors/impl#[PrivDropError][`From<(ErrorKind, &'static str)>`]from().((kind, description): (ErrorKindrust-analyzer cargo privdrop 0.5.4 errors/ErrorKind#, &'static str)) -> PrivDropErrorrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError# { |
| 48 | PrivDropErrorrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError# { |
| 49 | reprrust-analyzer cargo privdrop 0.5.4 errors/PrivDropError#repr.: ErrorReprrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr#::WithDescriptionrust-analyzer cargo privdrop 0.5.4 errors/ErrorRepr#WithDescription#(kind, description), |
| 50 | } |
| 51 | } |
| 52 | } |