xml_writer_to_string

Function xml_writer_to_string 

Source
pub fn xml_writer_to_string(writer: Writer<Cursor<Vec<u8>>>) -> String
Expand description

Convert a quick_xml::Writer to a String.

ยงExample

let robot = Link::builder("my-link")
    .add_visual(
        Visual::builder(SphereGeometry::new(4.0))
    )
    .build_tree()
    .to_robot("my-robot");

let writer = to_urdf(&robot, URDFConfig::default()).unwrap();
let urdf_description: String = xml_writer_to_string(writer);

assert_eq!(
    urdf_description,
    String::from(
        "\u{feff}<?xml version=\"1.0\"?><robot name=\"my-robot\"><link name=\"my-link\"><visual><geometry><sphere radius=\"4\"/></geometry></visual></link></robot>"
    )
);