XMLWriter

Struct XMLWriter 

Source
pub struct XMLWriter<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> XMLWriter<'a>

Source

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);
Source

pub fn xml_declaration(&mut self)

Write an XML file declaration.

writer.xml_declaration();
// Output: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
Source

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>
Source

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>
Source

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"/>
Source

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>
Source

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.

Source

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.

Source

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.

Source

pub fn xml_si_element(&mut self, string: &str, attributes: &Vec<(&str, &str)>)

Optimized tag writer for shared strings <si> elements.

Source

pub fn xml_rich_si_element(&mut self, string: &str)

Optimized tag writer for shared strings rich string elements.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.