pub struct DefinitionRead<T> {
pub frontmatter: Vec<(String, OrderedValue)>,
pub fields: Option<T>,
pub body: Option<String>,
pub diagnostics: Vec<SchemaDiagnostic>,
}Fields§
§frontmatter: Vec<(String, OrderedValue)>Ordered top-level mapping, retaining unknown authored keys.
fields: Option<T>§body: Option<String>§diagnostics: Vec<SchemaDiagnostic>Implementations§
Source§impl<T> DefinitionRead<T>
impl<T> DefinitionRead<T>
Sourcepub fn into_fields(self) -> Result<T, String>
pub fn into_fields(self) -> Result<T, String>
The typed fields, or why there are none: the frontmatter cannot be parsed at all.
Sourcepub fn into_valid(self) -> Result<Valid<T>, SchemaDiagnostic>
pub fn into_valid(self) -> Result<Valid<T>, SchemaDiagnostic>
What a caller that acts on the file needs: the fields, the body and the warnings that came with them, or the first error. A file with any error is refused whole.
Trait Implementations§
Source§impl<T: Clone> Clone for DefinitionRead<T>
impl<T: Clone> Clone for DefinitionRead<T>
Source§impl<T: Debug> Debug for DefinitionRead<T>
impl<T: Debug> Debug for DefinitionRead<T>
Auto Trait Implementations§
impl<T> Forget for DefinitionRead<T>
impl<T> Freeze for DefinitionRead<T>
impl<T> RefUnwindSafe for DefinitionRead<T>where
Option<T>: RefUnwindSafe,
impl<T> Send for DefinitionRead<T>
impl<T> Sync for DefinitionRead<T>
impl<T> Unpin for DefinitionRead<T>
impl<T> UnsafeUnpin for DefinitionRead<T>where
Option<T>: UnsafeUnpin,
impl<T> UnwindSafe for DefinitionRead<T>where
Option<T>: UnwindSafe,
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