Skip to main content

WriteXmlFields

Trait WriteXmlFields 

Source
pub trait WriteXmlFields {
    // Required method
    fn write_xml_fields(
        &self,
        writer: &mut Writer<Cursor<Vec<u8>>>,
    ) -> Result<(), XmlError>;
}
Expand description

Trait for types that can serialize their child fields into an XML writer.

Implemented by the code generator for all YANG structs (containers and list entries). This allows containers and list entries to embed their XML into a parent writer without creating a standalone document.

Required Methods§

Source

fn write_xml_fields( &self, writer: &mut Writer<Cursor<Vec<u8>>>, ) -> Result<(), XmlError>

Write this value’s child elements into writer.

Does not write the surrounding element start/end tags — the caller is responsible for those. This makes it easy to compose nested XML.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§