Struct las::writer::Writer[][src]

pub struct Writer<W: 'static + Write + Seek + Debug + Send> { /* 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

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]

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]

fn header(&self) -> &Header[src]

Returns a reference to this writer's header.

fn write(&mut self, point: Point) -> Result<()>[src]

Writes a point.

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.