pub fn write<W: Write>(gpx: &Gpx, writer: W) -> Result<(), GpxError>
Expand description
Writes an activity to GPX format.
Takes any std::io::Write
as its writer, and returns a
Result<(), GpxError>
.
use gpx::write;
use gpx::Gpx;
use gpx::GpxVersion;
let mut data : Gpx = Default::default();
data.version = GpxVersion::Gpx11;
// You can give it anything that implements `std::io::Write`.
write(&data, std::io::stdout()).unwrap();