Struct XMLWriter

Source
pub struct XMLWriter<W: Write> { /* private fields */ }
Expand description

Write as OSM XML file format

Trait Implementations§

Source§

impl<W: Write> Drop for XMLWriter<W>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<W: Write> OSMWriter<W> for XMLWriter<W>

Source§

fn new(writer: W) -> Self

Create a writer from an underying writer
Source§

fn set_header( &mut self, (key, value): (&str, &str), ) -> Result<(), OSMWriteError>

Source§

fn is_open(&self) -> bool

Return true iff this writer is not 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.
Source§

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.
Source§

fn write_obj(&mut self, obj: &impl OSMObj) -> Result<(), OSMWriteError>

Write an OSM object to this.
Source§

fn into_inner(self) -> W

Convert back to the underlying writer object
Source§

fn from_iter<I: Iterator<Item = impl OSMObj>>(writer: W, iter: I) -> Self
where Self: Sized,

Create a new OSMWriter, consume all the objects from an OSMObj iterator source, and then close this source. Returns this OSMWriter.

Auto Trait Implementations§

§

impl<W> Freeze for XMLWriter<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for XMLWriter<W>
where W: RefUnwindSafe,

§

impl<W> Send for XMLWriter<W>
where W: Send,

§

impl<W> Sync for XMLWriter<W>
where W: Sync,

§

impl<W> Unpin for XMLWriter<W>
where W: Unpin,

§

impl<W> UnwindSafe for XMLWriter<W>
where W: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.