[][src]Enum horned_functional::Error

pub enum Error {
    PestError(Error<Rule>),
    IOError(Error),
    ExpansionError(ExpansionError),
    InvalidFacet(String),
    Unsupported(&'static str, &'static str),
}

The error type for this crate.

Variants

PestError(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 = Ontology::from_ofn_str("Ontology(");
assert_matches!(res, Err(horned_functional::Error::PestError(_)));
IOError(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::IOError(_)));
ExpansionError(ExpansionError)

A CURIE expansion went wrong.

This error can be encountered in documents where a CURIE used an undefined prefix.

Example

use horned_functional::FromFunctional;

let res = IRI::from_ofn_str("example:Entity");
assert_matches!(res, Err(horned_functional::Error::ExpansionError(_)));
InvalidFacet(String)

An unknown IRI was used as a facet.

Example

use horned_functional::FromFunctional;

let res = Facet::from_ofn_str("<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

impl Debug for Error[src]

impl Display for Error[src]

impl Error for Error[src]

impl From<Error<Rule>> for Error[src]

impl From<Error> for Error[src]

impl From<ExpansionError> for Error[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsFail for T where
    T: Fail, 

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<E> Fail for E where
    E: 'static + Error + Send + Sync

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.