Struct las::Writer [] [src]

pub struct Writer<W: Seek + Write> { /* fields omitted */ }

Writes LAS data.

The LAS header needs to be re-written when the writer closes. For convenience, this is done via the Drop implementation of the writer. One consequence is that if the header re-write fails during the drop, a panic will result. If you want to check for errors instead of panicing, use close explicitly.

use std::io::Cursor;
{
    let mut writer = Writer::new(Cursor::new(Vec::new()), Default::default()).unwrap();
    writer.close().unwrap();
} // <- `close` is not called

Methods

impl<W: Seek + Write> Writer<W>
[src]

Creates a new writer.

Examples

use std::io::Cursor;
let writer = Writer::new(Cursor::new(Vec::new()), Default::default());

Writes a point.

Examples

use std::io::Cursor;

let mut writer = Writer::new(Cursor::new(Vec::new()), Default::default()).unwrap();
writer.write(&Default::default()).unwrap();

Close this writer.

A second call to close is a no-op.

Examples

use std::io::Cursor;
let mut writer = Writer::new(Cursor::new(Vec::new()), Default::default()).unwrap();
writer.close().unwrap();
writer.close().unwrap(); // <- no-op

impl Writer<BufWriter<File>>
[src]

Creates a new writer for a path.

Examples

let writer = Writer::from_path("/dev/null", Default::default());

Trait Implementations

impl<W: Debug + Seek + Write> Debug for Writer<W>
[src]

Formats the value using the given formatter.

impl<W: Seek + Write> Drop for Writer<W>
[src]

A method called when the value goes out of scope. Read more