pub fn write_with_event_writer<W: Write>(
    gpx: &Gpx,
    writer: &mut EventWriter<W>
) -> Result<(), GpxError>
Expand description

Writes an activity to GPX format.

Takes EventWriter as its writer, and returns a Result<(), GpxError>.

use gpx::write_with_event_writer;
use gpx::Gpx;
use gpx::GpxVersion;
use xml::writer::EmitterConfig;

let mut data : Gpx = Default::default();
data.version = GpxVersion::Gpx11;
let mut writer = EmitterConfig::new()
        .perform_indent(false)
        .create_writer(std::io::stdout());

write_with_event_writer(&data, &mut writer).unwrap();