Struct las::writer::Writer [−][src]
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
impl<W: 'static + Write + Seek + Debug + Send> Writer<W>
[src]
pub fn new(mut dest: W, mut header: Header) -> Result<Self>
[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());
pub fn close(&mut self) -> Result<()>
[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: 'static + Write + Seek + Debug + Send> Writer<W>
[src]
pub fn into_inner(mut self: Self) -> Result<W>
[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]
pub fn from_path<P: AsRef<Path>>(
path: P,
mut header: Header
) -> Result<Writer<BufWriter<File>>>
[src]
path: P,
mut 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
impl<W: Debug + 'static + Write + Seek + Send> Debug for Writer<W>
[src]
impl Default for Writer<Cursor<Vec<u8>>>
[src]
impl<W: 'static + Seek + Write + Debug + Send> Drop for Writer<W>
[src]
impl<W: 'static + Write + Seek + Debug + Send> Write for Writer<W>
[src]
Auto Trait Implementations
impl<W> !RefUnwindSafe for Writer<W>
[src]
impl<W> Send for Writer<W>
[src]
impl<W> !Sync for Writer<W>
[src]
impl<W> Unpin for Writer<W>
[src]
impl<W> !UnwindSafe for Writer<W>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,