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::<SetOntology, _>("/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
sourceimpl Error for Error
impl Error for Error
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<ExpansionError> for Error
impl From<ExpansionError> for Error
sourcefn from(e: ExpansionError) -> Self
fn from(e: ExpansionError) -> Self
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more