human_readable_time/
errors.rs

1use std::fmt::{Debug, Display, Formatter};
2
3/// The error which will be returned, if a value could not be parsed into an `HumanReadableDuration`
4pub struct ParseHumanReadableDurationError;
5
6/// `?` formatting.
7///
8/// `Debug` should format the output in a programmer-facing, debugging context.
9impl Debug for ParseHumanReadableDurationError {
10    /// Formats the value using the given formatter.
11    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
12        write!(f, "ParseHumanReadableDurationError")
13    }
14}
15
16/// Format trait for an empty format, `{}`.
17///
18/// `Display` is similar to [`Debug`], but `Display` is for user-facing
19/// output.
20impl Display for ParseHumanReadableDurationError {
21    /// Formats the value using the given formatter.
22    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
23        write!(f, "ParseHumanReadableDurationError")
24    }
25}
26
27impl std::error::Error for ParseHumanReadableDurationError {}