pub struct Document<'d> {
pub dom: XmlDoc,
pub path: String,
pub corpus: &'d Corpus,
pub dnm: Option<DNM>,
}
Expand description
One of our math documents.
Fields
dom: XmlDoc
The DOM of the document
path: String
The file path of the document
corpus: &'d Corpus
A reference to the corpus containing this document
dnm: Option<DNM>
If it exists, the DNM corresponding to this document
Implementations
sourceimpl<'d> Document<'d>
impl<'d> Document<'d>
sourcepub fn new(filepath: String, corpus: &'d Corpus) -> Result<Self, XmlParseError>
pub fn new(filepath: String, corpus: &'d Corpus) -> Result<Self, XmlParseError>
Load a new document
sourcepub fn paragraph_nodes(doc: &XmlDoc) -> Vec<RoNode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn paragraph_nodes(doc: &XmlDoc) -> Vec<RoNode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Obtain the problem-free logical paragraphs of a libxml Document
sourcepub fn paragraph_iter(&mut self) -> ParagraphIterator<'_>ⓘNotable traits for ParagraphIterator<'iter>impl<'iter> Iterator for ParagraphIterator<'iter> type Item = Paragraph<'iter>;
pub fn paragraph_iter(&mut self) -> ParagraphIterator<'_>ⓘNotable traits for ParagraphIterator<'iter>impl<'iter> Iterator for ParagraphIterator<'iter> type Item = Paragraph<'iter>;
Get an iterator over the paragraphs of the document
sourcepub fn get_math_nodes(&self) -> Vec<RoNode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn get_math_nodes(&self) -> Vec<RoNode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Obtain the MathML
sourcepub fn get_ref_nodes(&self) -> Vec<RoNode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn get_ref_nodes(&self) -> Vec<RoNode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Obtain the <span[class=ltx_ref]> nodes of a libxml Document
sourcepub fn sentence_iter(&mut self) -> SentenceIterator<'_>ⓘNotable traits for SentenceIterator<'iter>impl<'iter> Iterator for SentenceIterator<'iter> type Item = Sentence<'iter>;
pub fn sentence_iter(&mut self) -> SentenceIterator<'_>ⓘNotable traits for SentenceIterator<'iter>impl<'iter> Iterator for SentenceIterator<'iter> type Item = Sentence<'iter>;
Get an iterator over the sentences of the document
Auto Trait Implementations
impl<'d> !RefUnwindSafe for Document<'d>
impl<'d> !Send for Document<'d>
impl<'d> !Sync for Document<'d>
impl<'d> Unpin for Document<'d>
impl<'d> !UnwindSafe for Document<'d>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more