rocket_http_community/uri/
error.rs1use std::fmt;
4
5pub use crate::parse::uri::Error;
6
7#[derive(Debug, Copy, Clone, PartialEq, Eq)]
9pub struct TryFromUriError(pub(crate) ());
10
11impl fmt::Display for TryFromUriError {
12 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
13 "invalid conversion from general to specific URI variant".fmt(f)
14 }
15}
16
17#[derive(Debug, PartialEq, Eq, Clone)]
23pub enum PathError {
24 BadStart(char),
26 BadChar(char),
28 BadEnd(char),
30}
31
32impl fmt::Display for PathError {
33 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
34 match self {
35 PathError::BadStart(c) => write!(f, "invalid initial character: {c:?}"),
36 PathError::BadChar(c) => write!(f, "invalid character: {c:?}"),
37 PathError::BadEnd(c) => write!(f, "invalid terminal character: {c:?}"),
38 }
39 }
40}
41
42impl std::error::Error for PathError {}