pub struct TreeBuilder { /* private fields */ }Expand description
Builds a Document from events, in document order.
Adjacent text is merged into one text node and empty text is dropped, as the XDM requires. Attributes must come right after their element’s start, before its content; an attribute whose expanded name is already on the element replaces it.
Implementations§
Source§impl TreeBuilder
impl TreeBuilder
Sourcepub fn start_element(&mut self, name: QName) -> Result<(), DocumentError>
pub fn start_element(&mut self, name: QName) -> Result<(), DocumentError>
Sourcepub fn attribute(
&mut self,
name: QName,
value: &str,
) -> Result<(), DocumentError>
pub fn attribute( &mut self, name: QName, value: &str, ) -> Result<(), DocumentError>
Adds an attribute to the element just opened.
§Errors
No element is open, or the element already has content.
Sourcepub fn processing_instruction(
&mut self,
target: &str,
value: &str,
) -> Result<(), DocumentError>
pub fn processing_instruction( &mut self, target: &str, value: &str, ) -> Result<(), DocumentError>
Sourcepub fn end_element(&mut self) -> Result<(), DocumentError>
pub fn end_element(&mut self) -> Result<(), DocumentError>
Trait Implementations§
Source§impl Debug for TreeBuilder
impl Debug for TreeBuilder
Auto Trait Implementations§
impl Forget for TreeBuilder
impl Freeze for TreeBuilder
impl RefUnwindSafe for TreeBuilder
impl Send for TreeBuilder
impl Sync for TreeBuilder
impl Unpin for TreeBuilder
impl UnsafeUnpin for TreeBuilder
impl UnwindSafe for TreeBuilder
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