| 1 | use std::{error, fmt}; |
|---|---|
| 2 | |
| 3 | /// Error returned if the inner [`Service`] has not been set. |
| 4 | /// |
| 5 | /// [`Service`]: crate::Service |
| 6 | #[derive(Debug)] |
| 7 | pub struct None(()); |
| 8 | |
| 9 | impl None { |
| 10 | pub(crate) fn new() -> None { |
| 11 | None(()) |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | impl fmt::Display for None { |
| 16 | fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { |
| 17 | write!(fmt, "None") |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | impl error::Error for None {} |
| 22 |
