pub struct XMLWriter<'a> { /* private fields */ }Implementations§
Source§impl<'a> XMLWriter<'a>
impl<'a> XMLWriter<'a>
Sourcepub fn new(xmlfile: &File) -> XMLWriter<'_>
pub fn new(xmlfile: &File) -> XMLWriter<'_>
Create a new XMLWriter struct to write XML to a given filehandle.
let xmlfile = File::create("test.xml")?;
let mut writer = XMLWriter::new(&xmlfile);Sourcepub fn xml_declaration(&mut self)
pub fn xml_declaration(&mut self)
Write an XML file declaration.
writer.xml_declaration();
// Output: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>Sourcepub fn xml_start_tag(&mut self, tag: &str, attributes: &Vec<(&str, &str)>)
pub fn xml_start_tag(&mut self, tag: &str, attributes: &Vec<(&str, &str)>)
Write an XML start tag with attributes.
let attributes = vec![("bar", "1")];
writer.xml_data_element("foo", "some text", &attributes);
// Output: <foo bar="1">some text</foo>Sourcepub fn xml_end_tag(&mut self, tag: &str)
pub fn xml_end_tag(&mut self, tag: &str)
Write an XML end tag.
writer.xml_end_tag("foo");
// Output: </foo>
// Output: <foo bar="1">some text</foo>Sourcepub fn xml_empty_tag(&mut self, tag: &str, attributes: &Vec<(&str, &str)>)
pub fn xml_empty_tag(&mut self, tag: &str, attributes: &Vec<(&str, &str)>)
Write an empty XML tag with attributes.
let attributes = vec![("bar", "1"), ("car", "y")];
writer.xml_empty_tag("foo", &attributes);
// Output: <foo bar="1" car="y"/>Sourcepub fn xml_data_element(
&mut self,
tag: &str,
data: &str,
attributes: &Vec<(&str, &str)>,
)
pub fn xml_data_element( &mut self, tag: &str, data: &str, attributes: &Vec<(&str, &str)>, )
Write an XML element containing data with optional attributes.
let attributes = vec![("bar", "1")];
writer.xml_data_element("foo", "some text", &attributes);
// Output: <foo bar="1">some text</foo>Sourcepub fn xml_string_element(&mut self, index: u32, attributes: &Vec<(&str, &str)>)
pub fn xml_string_element(&mut self, index: u32, attributes: &Vec<(&str, &str)>)
Optimized tag writer for <c> cell string elements in the inner loop.
Sourcepub fn xml_number_element(
&mut self,
number: f64,
attributes: &Vec<(&str, &str)>,
)
pub fn xml_number_element( &mut self, number: f64, attributes: &Vec<(&str, &str)>, )
Optimized tag writer for <c> cell number elements in the inner loop.
Sourcepub fn xml_formula_element(
&mut self,
formula: &str,
result: f64,
attributes: &Vec<(&str, &str)>,
)
pub fn xml_formula_element( &mut self, formula: &str, result: f64, attributes: &Vec<(&str, &str)>, )
Optimized tag writer for <c> cell formula elements in the inner loop.
Sourcepub fn xml_si_element(&mut self, string: &str, attributes: &Vec<(&str, &str)>)
pub fn xml_si_element(&mut self, string: &str, attributes: &Vec<(&str, &str)>)
Optimized tag writer for shared strings <si> elements.
Sourcepub fn xml_rich_si_element(&mut self, string: &str)
pub fn xml_rich_si_element(&mut self, string: &str)
Optimized tag writer for shared strings
Auto Trait Implementations§
impl<'a> Freeze for XMLWriter<'a>
impl<'a> RefUnwindSafe for XMLWriter<'a>
impl<'a> Send for XMLWriter<'a>
impl<'a> Sync for XMLWriter<'a>
impl<'a> Unpin for XMLWriter<'a>
impl<'a> UnwindSafe for XMLWriter<'a>
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