pub enum Error {
Cardinality(CardinalityError),
Syntax(SyntaxError),
}Expand description
The error type for this crate.
Variants§
Cardinality(CardinalityError)
An error caused by a clause appearing an invalid number of times.
For instance, OBO frames have union_of clauses, that can not appear
only once: they must appear zero, or more than two times. Having a
frame with a single union_of clause will error when attempting to
translate the whole document.
§Example:
use fastobo_owl::IntoOwl;
use fastobo_owl::IntoOwlPrefixes;
let mut frame = TermFrame::new(ClassIdent::from(PrefixedIdent::new("TST", "001")));
let id = Box::new(ClassIdent::from(PrefixedIdent::new("TST", "002")));
frame.push(Line::from(TermClause::UnionOf(id)));
let doc = OboDoc::with_entities(vec![EntityFrame::from(frame)]);
let res = doc.into_owl::<SetOntology<String>>();
assert!(matches!(res, Err(fastobo_owl::Error::Cardinality(_))));Syntax(SyntaxError)
An error caused by an element in invalid syntax.
This can be raised while building IRI and Version IRI for an OWL
ontology from an OBO ontology header clause, which may contain
invalid data.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<CardinalityError> for Error
impl From<CardinalityError> for Error
Source§fn from(source: CardinalityError) -> Self
fn from(source: CardinalityError) -> Self
Converts to this type from the input type.
Source§impl From<SyntaxError> for Error
impl From<SyntaxError> for Error
Source§fn from(source: SyntaxError) -> Self
fn from(source: SyntaxError) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more