1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
//! Error and result type for IRI resolution.

use thiserror::Error;

/// Type alias for `Result` with default error `TermError`.
///
/// Can be used like `std::result::Result` as well.
pub type Result<T, E = InvalidIri> = std::result::Result<T, E>;

/// This error is raised when trying to parse an invalid IRI.
#[derive(Debug, Error)]
#[error("The given IRI '{0}' is not valid according to RFC3987")]
pub struct InvalidIri(pub String);