Trait IntoXml

Source
pub trait IntoXml: Sized {
    // Required method
    fn write_xml(self, writer: impl Write) -> Result<()>;

    // Provided method
    fn into_xml(self) -> Result<Bytes> { ... }
}
Expand description

Performs serialization to XML.

This trait is automatically implemented for any type which implements the Element + Into<Value> traits. As such, IntoXml shouldn’t be implemented directly: Element and Into<Value> should be implemented instead, and you get the IntoXml implementation for free.

Required Methods§

Source

fn write_xml(self, writer: impl Write) -> Result<()>

Provided Methods§

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.

Implementors§

Source§

impl<T> IntoXml for T
where T: Element + Into<Value>,