#[derive(Debug)]
pub enum Component {
Scheme,
Authority,
Path,
Query,
Fragment,
}
error_chain! {
errors {
#[doc = "An IRI cannot be constructed from the empty string."]
IsEmpty {
description("An IRI cannot be constructed from the empty string.")
display("An IRI cannot be constructed from the empty string.")
}
#[doc = "An error occurred normalizing an IRI component."]
Normalization(c: Component) {
description("An error occurred normalizing an IRI component.")
display("An error occurred normalizing the {:?} IRI component.", c)
}
#[doc = "An invalid character was found."]
InvalidChar(c: Component) {
description("An invalid character was found.")
display("An invalid character was found in the {:?} IRI component.", c)
}
#[doc = "Provided String value is not a valid IRI."]
Syntax(s: String) {
description("Provided String value is not a valid IRI.")
display("Provided String value `{}` was is a valid IRI.", s)
}
#[doc = "The current IRI is not a valid base URI (RFC-3986§5.2.1)."]
NotValidBase {
description("The current IRI is not a valid base URI (RFC-3986§5.2.1).")
display("The current IRI is not a valid base URI (RFC-3986§5.2.1).")
}
#[doc = "A PrefixedName may not have an empty name part."]
EmptyPrefixedName {
description("A PrefixedName may not have an empty name part.")
display("A PrefixedName may not have an empty name part.")
}
#[doc = "The String value provided is not a valid PrefixedName."]
InvalidPrefixedName(s: String) {
description("The String value provided is not a valid PrefixedName.")
display("The String value `{}` is not a valid PrefixedName.", s)
}
}
}