pub struct DocumentBuilder { /* private fields */ }Expand description
Builder for constructing XML documents.
This is used internally by the parser but can also be used to programmatically build documents.
The builder avoids RwLock overhead during construction by storing nodes directly in a Vec. The lock is only created when build() is called.
Implementations§
Source§impl DocumentBuilder
impl DocumentBuilder
Sourcepub fn start_element(
&mut self,
name: &str,
prefix: Option<&str>,
namespace_uri: Option<&str>,
attributes: Vec<(&str, &str)>,
namespace_decls: Vec<Namespace>,
line: Option<usize>,
column: Option<usize>,
) -> NodeId
pub fn start_element( &mut self, name: &str, prefix: Option<&str>, namespace_uri: Option<&str>, attributes: Vec<(&str, &str)>, namespace_decls: Vec<Namespace>, line: Option<usize>, column: Option<usize>, ) -> NodeId
Starts a new element.
Sourcepub fn end_element(&mut self)
pub fn end_element(&mut self)
Ends the current element.
Sourcepub fn processing_instruction(
&mut self,
target: &str,
content: Option<&str>,
) -> NodeId
pub fn processing_instruction( &mut self, target: &str, content: Option<&str>, ) -> NodeId
Adds a processing instruction.
Sourcepub fn build(self) -> XmlDocument
pub fn build(self) -> XmlDocument
Finishes building and returns the document.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DocumentBuilder
impl RefUnwindSafe for DocumentBuilder
impl Send for DocumentBuilder
impl Sync for DocumentBuilder
impl Unpin for DocumentBuilder
impl UnwindSafe for DocumentBuilder
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