Struct las::writer::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;
use las::Writer;
{
    let mut writer = Writer::default();
    writer.close().unwrap();
} // <- `close` is not called

Methods

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

[src]

Creates a new writer.

The header that is passed in will have various fields zero'd, e.g. bounds, number of points, etc.

Examples

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

[src]

Returns a reference to this writer's header.

Examples

use las::Writer;
let writer = Writer::default();
let header = writer.header();

[src]

Writes a point.

Examples

use std::io::Cursor;
use las::Writer;

let mut writer = Writer::default();
writer.write(Default::default()).unwrap();

[src]

Close this writer.

Examples

use std::io::Cursor;
use las::Writer;
let mut writer = Writer::default();
writer.close().unwrap();
assert!(writer.close().is_err());

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

[src]

Closes this writer and returns its inner Write, seeked to the beginning of the las data.

Examples

use las::Writer;
let writer = Writer::default();
let cursor = writer.into_inner().unwrap();

impl Writer<BufWriter<File>>
[src]

[src]

Creates a new writer for a path.

Examples

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

Trait Implementations

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

[src]

Formats the value using the given formatter.

impl Default for Writer<Cursor<Vec<u8>>>
[src]

[src]

Returns the "default value" for a type. Read more

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

[src]

Executes the destructor for this type. Read more