miniserde/
error.rs

1use core::fmt::{self, Display};
2
3/// Error type when deserialization fails.
4///
5/// Miniserde errors contain no information about what went wrong. **If you need
6/// more than no information, use Serde.**
7#[derive(#[automatically_derived]
impl ::core::marker::Copy for Error { }Copy, #[automatically_derived]
impl ::core::clone::Clone for Error {
    #[inline]
    fn clone(&self) -> Error { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Error {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f, "Error")
    }
}Debug)]
8pub struct Error;
9
10/// Result type returned by deserialization functions.
11pub type Result<T> = core::result::Result<T, Error>;
12
13impl Display for Error {
14    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
15        formatter.write_str("miniserde error")
16    }
17}
18
19#[cfg(feature = "std")]
20impl std::error::Error for Error {}