]>
git.proxmox.com Git - rustc.git/blob - src/vendor/error-chain/src/example_generated.rs
1 //! These modules show an example of code generated by the macro. **IT MUST NOT BE
2 //! USED OUTSIDE THIS CRATE**.
4 //! This is the basic error structure. You can see that `ErrorKind`
5 //! has been populated in a variety of ways. All `ErrorKind`s get a
6 //! `Msg` variant for basic errors. When strings are converted to
7 //! `ErrorKind`s they become `ErrorKind::Msg`. The "links" defined in
8 //! the macro are expanded to the `Inner` variant, and the
9 //! "foreign links" to the `Io` variant.
11 //! Both types come with a variety of `From` conversions as well:
12 //! `Error` can be created from `ErrorKind`, `&str` and `String`,
13 //! and the `links` and `foreign_links` error types. `ErrorKind`
14 //! can be created from the corresponding `ErrorKind`s of the link
15 //! types, as well as from `&str` and `String`.
17 //! `into()` and `From::from` are used heavily to massage types into
18 //! the right shape. Which one to use in any specific case depends on
19 //! the influence of type inference, but there are some patterns that
22 /// Another code generated by the macro.
29 Inner(inner
::Error
, inner
::ErrorKind
) #[doc = "Link to another `ErrorChain`."];
32 Io(::std
::io
::Error
) #[doc = "Link to a `std::error::Error` type."];
35 #[doc = "A custom error kind."]