pub struct Writer<W: 'static + Write + Seek + Debug + Send> { /* private fields */ }
Expand description
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
Implementations§
source§impl<W: 'static + Write + Seek + Debug + Send> Writer<W>
impl<W: 'static + Write + Seek + Debug + Send> Writer<W>
source§impl<W: 'static + Write + Seek + Debug + Send> Writer<W>
impl<W: 'static + Write + Seek + Debug + Send> Writer<W>
sourcepub fn into_inner(self) -> Result<W>
pub fn into_inner(self) -> Result<W>
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();
source§impl Writer<BufWriter<File>>
impl Writer<BufWriter<File>>
sourcepub fn from_path<P: AsRef<Path>>(
path: P,
header: Header
) -> Result<Writer<BufWriter<File>>>
pub fn from_path<P: AsRef<Path>>( path: P, header: Header ) -> Result<Writer<BufWriter<File>>>
Creates a new writer for a path.
If the “laz” feature is enabled, guesses from the extension if the data will be written compressed
§Examples
use las::Writer;
let writer = Writer::from_path("/dev/null", Default::default());
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for Writer<W>
impl<W> !RefUnwindSafe for Writer<W>
impl<W> Send for Writer<W>
impl<W> !Sync for Writer<W>
impl<W> Unpin for Writer<W>
impl<W> !UnwindSafe for Writer<W>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more