pub struct FragmentReader { /* private fields */ }Expand description
Iterates the top-level subtrees of an XML file (the children of its root
element), materializing one owned [Document] at a time.
Implementations§
Source§impl FragmentReader
impl FragmentReader
Sourcepub fn open(path: &Path) -> Result<Self>
pub fn open(path: &Path) -> Result<Self>
Open path for streaming. The file’s root element (e.g. the
_lxfragment wrapper of a spilled segment, or ltx:document of a full
core-XML file) is consumed as the container; fragments are its children.
Sourcepub fn next_fragment(&mut self) -> Result<Option<Document>>
pub fn next_fragment(&mut self) -> Result<Option<Document>>
Advance to the next top-level element and materialize its whole subtree
as an owned, mutable [Document]. Returns Ok(None) at the end of the
container. Non-element content between fragments (whitespace, comments,
PIs) is skipped.
Auto Trait Implementations§
impl !Send for FragmentReader
impl !Sync for FragmentReader
impl Freeze for FragmentReader
impl RefUnwindSafe for FragmentReader
impl Unpin for FragmentReader
impl UnsafeUnpin for FragmentReader
impl UnwindSafe for FragmentReader
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