#[non_exhaustive]pub enum DocumentError {
UnterminatedFrontmatter,
FrontmatterNotMapping,
InvalidYaml(YamlError),
MissingKeys(Vec<String>),
InvalidConceptId(ConceptIdError),
}Expand description
Errors raised when parsing or validating a single OKF concept document.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
UnterminatedFrontmatter
The frontmatter opened with --- but no closing --- was found.
FrontmatterNotMapping
The frontmatter block did not contain a YAML mapping.
InvalidYaml(YamlError)
The YAML frontmatter could not be parsed.
MissingKeys(Vec<String>)
Required frontmatter keys are missing or empty.
InvalidConceptId(ConceptIdError)
The file’s path could not be turned into a valid concept id.
Trait Implementations§
Source§impl Clone for DocumentError
impl Clone for DocumentError
Source§fn clone(&self) -> DocumentError
fn clone(&self) -> DocumentError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DocumentError
impl Debug for DocumentError
Source§impl Display for DocumentError
impl Display for DocumentError
impl Eq for DocumentError
Source§impl Error for DocumentError
impl Error for DocumentError
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<ConceptIdError> for DocumentError
impl From<ConceptIdError> for DocumentError
Source§fn from(e: ConceptIdError) -> Self
fn from(e: ConceptIdError) -> Self
Converts to this type from the input type.
Source§impl From<YamlError> for DocumentError
impl From<YamlError> for DocumentError
Source§impl PartialEq for DocumentError
impl PartialEq for DocumentError
impl StructuralPartialEq for DocumentError
Auto Trait Implementations§
impl Freeze for DocumentError
impl RefUnwindSafe for DocumentError
impl Send for DocumentError
impl Sync for DocumentError
impl Unpin for DocumentError
impl UnsafeUnpin for DocumentError
impl UnwindSafe for DocumentError
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