[−][src]Trait osmio::OSMWriter
A generic writer for OSM objects.
Required methods
fn new(_: W) -> Self
Create a writer from an underying writer
fn close(&mut self) -> Result<(), OSMWriteError>
Close this writer, cannot write any more objects.
Some fileformats have certain 'end of file' things. After you write those, you cannot write
any more OSM objects. e.g. an XML file format will require that you close your root XML
tag.
After calling this method, you cannot add any more OSM objects to this writer, and
is_open
will return false
.
fn is_open(&self) -> bool
Return true iff this writer is closed. If open you should be able to continue to write objects to it. if closed you cannot write any more OSM objects to it.
fn write_obj(&mut self, obj: &impl OSMObj) -> Result<(), OSMWriteError>
Write an OSM object to this.
fn into_inner(self) -> W
Convert back to the underlying writer object
Provided methods
fn set_header(&mut self, _key_value: (&str, &str)) -> Result<(), OSMWriteError>
fn from_iter<I: Iterator<Item = impl OSMObj>>(writer: W, iter: I) -> Self where
Self: Sized,
Self: Sized,
Create a new OSMWriter, consume all the objects from an OSMObj iterator source, and then close this source. Returns this OSMWriter.
Implementors
impl<W: Write> OSMWriter<W> for OSCWriter<W>
[src]
fn new(writer: W) -> Self
[src]
fn is_open(&self) -> bool
[src]
fn close(&mut self) -> Result<(), OSMWriteError>
[src]
fn write_obj(&mut self, obj: &impl OSMObj) -> Result<(), OSMWriteError>
[src]
fn into_inner(self) -> W
[src]
impl<W: Write> OSMWriter<W> for XMLWriter<W>
[src]
fn new(writer: W) -> Self
[src]
fn set_header(
&mut self,
(key, value): (&str, &str)
) -> Result<(), OSMWriteError>
[src]
&mut self,
(key, value): (&str, &str)
) -> Result<(), OSMWriteError>