#[cfg(feature = "std")] impl std::error::Error for Error {} #[cfg(not(feature = "std"))] impl serde_core::de::StdError for Error {}
/// Errors that can occur when deserializing a type. #[derive(Debug, Clone, PartialEq, Eq, Hash)] #[non_exhaustive] pub(crate) enum ErrorInner { /// Type could not be serialized to TOML
UnsupportedType(Option<&'static str>), /// Value was out of range for the given type
OutOfRange(Option<&'static str>), /// `None` could not be serialized to TOML
UnsupportedNone, /// Key was not convertible to `String` for serializing to TOML
KeyNotString, /// A serialized date was invalid
DateInvalid, /// Other serialization error
Custom(String),
}
impl core::fmt::Display for ErrorInner { fn fmt(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { matchself { Self::UnsupportedType(Some(t)) => write!(formatter, "unsupported {t} type"), Self::UnsupportedType(None) => write!(formatter, "unsupported rust type"), Self::OutOfRange(Some(t)) => write!(formatter, "out-of-range value for {t} type"), Self::OutOfRange(None) => write!(formatter, "out-of-range value"), Self::UnsupportedNone => "unsupported None value".fmt(formatter), Self::KeyNotString => "map key was not a string".fmt(formatter), Self::DateInvalid => "a serialized date was invalid".fmt(formatter), Self::Custom(s) => s.fmt(formatter),
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.