Struct treexml::Document [−][src]
pub struct Document { pub version: XmlVersion, pub encoding: String, pub root: Option<Element>, }
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
Methods
impl Document
[src]
impl Document
pub fn new() -> Document
[src]
pub fn new() -> Document
Create a new Document
with default values
pub fn build(root: &mut ElementBuilder) -> Self
[src]
pub fn build(root: &mut ElementBuilder) -> Self
Create a new Document
with an Element or ElementBuilder at its root.
pub fn parse<R: Read>(r: R) -> Result<Document, Error>
[src]
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>
[src]
pub fn write<W: Write>(&self, w: &mut W) -> Result<(), Error>
pub fn write_with<W: Write>(
&self,
w: &mut W,
document_decl: bool,
indent_str: &'static str,
indent: bool
) -> Result<(), Error>
[src]
pub fn write_with<W: Write>(
&self,
w: &mut W,
document_decl: bool,
indent_str: &'static str,
indent: bool
) -> Result<(), Error>
Writes a document to w
Trait Implementations
impl Debug for Document
[src]
impl Debug for Document
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Document
[src]
impl Clone for Document
fn clone(&self) -> Document
[src]
fn clone(&self) -> Document
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl PartialEq for Document
[src]
impl PartialEq for Document
fn eq(&self, other: &Document) -> bool
[src]
fn eq(&self, other: &Document) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Document) -> bool
[src]
fn ne(&self, other: &Document) -> bool
This method tests for !=
.
impl Eq for Document
[src]
impl Eq for Document
impl Default for Document
[src]
impl Default for Document
impl Display for Document
[src]
impl Display for Document