pub struct Document {
pub version: XmlVersion,
pub encoding: String,
pub root: Option<Element>,
}
Expand description
An XML document
Fields§
§version: XmlVersion
Version of the XML document
encoding: String
Encoding of the XML document
root: Option<Element>
Root tag of the XML document
Implementations§
Source§impl Document
impl Document
Sourcepub fn build(root: &mut ElementBuilder) -> Self
pub fn build(root: &mut ElementBuilder) -> Self
Create a new Document
with an Element or ElementBuilder at its root.
Sourcepub fn parse<R: Read>(r: R) -> Result<Document, Error>
pub fn parse<R: Read>(r: R) -> Result<Document, Error>
Parse data from a reader to construct an XML document
§Failures
Passes any errors that the xml-rs
library returns up the stack
pub fn write<W: Write>(&self, w: &mut W) -> Result<(), Error>
Trait Implementations§
impl Eq for Document
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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