pub trait ToXml {
// Provided methods
fn write_attrs<'a>(&self, start: BytesStart<'a>) -> BytesStart<'a> { ... }
fn write_children<W: Write>(
&self,
_writer: &mut Writer<W>,
) -> Result<(), SerializeError> { ... }
fn is_empty_element(&self) -> bool { ... }
fn write_element<W: Write>(
&self,
tag: &str,
writer: &mut Writer<W>,
) -> Result<(), SerializeError> { ... }
}Expand description
Trait for types that can be serialized to XML elements.
Implemented by generated OOXML types to enable roundtrip serialization.
Provided Methods§
Sourcefn write_attrs<'a>(&self, start: BytesStart<'a>) -> BytesStart<'a>
fn write_attrs<'a>(&self, start: BytesStart<'a>) -> BytesStart<'a>
Write attributes onto the start tag and return it.
Sourcefn write_children<W: Write>(
&self,
_writer: &mut Writer<W>,
) -> Result<(), SerializeError>
fn write_children<W: Write>( &self, _writer: &mut Writer<W>, ) -> Result<(), SerializeError>
Write child elements and text content inside the element.
Sourcefn is_empty_element(&self) -> bool
fn is_empty_element(&self) -> bool
Whether this element has no children (self-closing).
Sourcefn write_element<W: Write>(
&self,
tag: &str,
writer: &mut Writer<W>,
) -> Result<(), SerializeError>
fn write_element<W: Write>( &self, tag: &str, writer: &mut Writer<W>, ) -> Result<(), SerializeError>
Write a complete element: <tag attrs>children</tag> or <tag attrs/>.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.