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]
fn new(write: W, header: Header) -> Result<Writer<W>>
Creates a new writer.
Examples
use std::io::Cursor; let writer = Writer::new(Cursor::new(Vec::new()), Default::default());
fn write(&mut self, point: &Point) -> Result<()>
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();
fn close(&mut self) -> Result<()>
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]
fn from_path<P: AsRef<Path>>(
path: P,
header: Header
) -> Result<Writer<BufWriter<File>>>
path: P,
header: Header
) -> Result<Writer<BufWriter<File>>>
Creates a new writer for a path.
Examples
let writer = Writer::from_path("/dev/null", Default::default());