kv_derive_impl/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug, PartialEq)]
4pub enum Error {
5    /// The input doesn't contain the specified key.
6    #[error("missing key: `{0}`")]
7    MissingKey(&'static str),
8
9    /// Could not parse a boolean value.
10    #[error("could not parse a boolean value")]
11    ParseBoolError(#[from] std::str::ParseBoolError),
12
13    /// Could not parse an integer.
14    #[error("could not parse an integer")]
15    ParseIntError(#[from] std::num::ParseIntError),
16
17    /// Could not parse a floating-point number.
18    #[error("could not parse a floating-point number")]
19    ParseFloatError(#[from] std::num::ParseFloatError),
20
21    /// Could not parse a network address.
22    #[error("could not parse a network address")]
23    AddrParseError(#[from] std::net::AddrParseError),
24
25    #[error("infallible")]
26    Infallible(#[from] std::convert::Infallible),
27}