oct/error/
system_time_decode_error.rs1#![cfg(feature = "std")]
10
11use core::convert::Infallible;
12use core::error::Error;
13use core::fmt::{self, Display, Formatter};
14
15#[cfg_attr(feature = "unstable-docs", doc(cfg(feature = "std")))]
20#[derive(Debug, Eq, PartialEq)]
21#[must_use]
22pub struct SystemTimeDecodeError {
23 pub timestamp: i64,
25}
26
27#[cfg_attr(feature = "unstable-docs", doc(cfg(feature = "std")))]
28impl Display for SystemTimeDecodeError {
29 #[inline]
30 fn fmt(&self, f: &mut Formatter) -> fmt::Result {
31 write!(f, "could not represent `{}` as a system timestamp", self.timestamp)
32 }
33}
34
35#[cfg_attr(feature = "unstable-docs", doc(cfg(feature = "std")))]
36impl Error for SystemTimeDecodeError { }
37
38#[cfg_attr(feature = "unstable-docs", doc(cfg(feature = "std")))]
39impl From<Infallible> for SystemTimeDecodeError {
40 #[inline(always)]
41 fn from(_value: Infallible) -> Self {
42 unreachable!()
43 }
44}