Enum horned_functional::Error
source · [−]pub enum Error {
Pest(Error<Rule>),
IO(Error),
Expansion(ExpansionError),
InvalidFacet(String),
Unsupported(&'static str, &'static str),
}Expand description
The error type for this crate.
Variants
Pest(Error<Rule>)
An error that occurred at the pest parser level.
This is returned from any parsing methods when the input is written with invalid syntax, or when attempting to parse an incomplete input.
Example:
use horned_functional::FromFunctional;
let res = SetOntology::from_ofn("Ontology(");
assert_matches!(res, Err(horned_functional::Error::Pest(_)));IO(Error)
An error that happened at the I/O level.
Example:
let res = horned_functional::from_file("/some/missing/file").map(|x| x.0);
assert_matches!(res, Err(horned_functional::Error::IO(_)));Expansion(ExpansionError)
A CURIE expansion went wrong.
This error can be encountered in documents where a CURIE used an undefined prefix, or when attempting to parse an abbreviated IRI without providing a prefix mapping.
Example
use horned_functional::FromFunctional;
let res = IRI::from_ofn("example:Entity");
assert_matches!(res, Err(horned_functional::Error::Expansion(_)));InvalidFacet(String)
An unknown IRI was used as a facet.
Example
use horned_functional::FromFunctional;
let res = Facet::from_ofn("<http://example.com/thing>");
assert_matches!(res, Err(horned_functional::Error::InvalidFacet(_)));Unsupported(&'static str, &'static str)
An unsupported construct was used.
See the relevant issue for each unsupported syntax construct; if the
issue has been resolved, please open an issue on the
fastobo/horned-functional
repository so that it can be fixed.
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
Blanket Implementations
pub fn as_fail(&self) -> &(dyn Fail + 'static)
pub fn as_fail(&self) -> &(dyn Fail + 'static)
Converts a reference to Self into a dynamic trait object of Fail.
Mutably borrows from an owned value. Read more