pub struct ParLasZipCompressor<W> { /* private fields */ }
Expand description

LasZip compressor that compresses using multiple threads

This supports both variable-size and fixed-size chunks. The method you need to call in order to compress data depends on which type of sized chunks you want to write.

It’s the LazVlr that controls which type of chunks you want to write.

You must call done when you have compressed all the points you wanted.

§Fixed-Size

Use compress_many

This works by forming complete chunks of points with the points data passed when compress_many is called. These complete chunks are compressed & written right away and points that are ‘leftovers’ are kept until the next call to compress_many or done.

§Variable-Size

Use compress_chunks

Implementations§

source§

impl<W: Write + Seek + Send> ParLasZipCompressor<W>

source

pub fn new(dest: W, vlr: LazVlr) -> Result<Self>

Creates a new ParLasZipCompressor

No i/o operation are performed

source

pub fn reserve_offset_to_chunk_table(&mut self) -> Result<()>

Reserves and prepares the offset to chunk table that will be updated when done is called.

This method will automatically be called on the first point(s) being compressed, but for some scenarios, manually calling this might be useful as it allow storing the position where the chunk table offset is.

source

pub fn compress_many(&mut self, points: &[u8]) -> Result<()>

Compresses many points using multiple threads.

§Important

This must be called only when writing fixed-size chunks. This will panic otherwise.

§Note

For this function to actually use multiple threads, the points buffer shall hold more points that the vlr’s chunk_size.

source

pub fn compress_chunks<Chunks, Item>(&mut self, chunks: Chunks) -> Result<()>
where Item: AsRef<[u8]> + Send, Chunks: IntoParallelIterator<Item = Item>,

Compresses multiple chunks using multiple threads.

§Important

This must be called only when writing variable-size chunks. This will panic otherwise.

§Note

For this function to actually use multiple threads, their should be more that one chunk. buffer shall hold more points that the vlr’s chunk_size.

source

pub fn done(&mut self) -> Result<()>

Tells the compressor that no more points will be compressed

  • Compresses & writes the rest of the points to form the last chunk
  • Writes the chunk table
  • update the offset to the chunk_table
source

pub fn vlr(&self) -> &LazVlr

source

pub fn into_inner(self) -> W

source

pub fn get_mut(&mut self) -> &mut W

source

pub fn get(&self) -> &W

Trait Implementations§

source§

impl<W: Write + Seek + Send> LazCompressor for ParLasZipCompressor<W>

source§

fn compress_one(&mut self, point: &[u8]) -> Result<()>

source§

fn compress_many(&mut self, points: &[u8]) -> Result<()>

source§

fn reserve_offset_to_chunk_table(&mut self) -> Result<()>

source§

fn done(&mut self) -> Result<()>

Auto Trait Implementations§

§

impl<W> Freeze for ParLasZipCompressor<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for ParLasZipCompressor<W>
where W: RefUnwindSafe,

§

impl<W> Send for ParLasZipCompressor<W>
where W: Send,

§

impl<W> Sync for ParLasZipCompressor<W>
where W: Sync,

§

impl<W> Unpin for ParLasZipCompressor<W>
where W: Unpin,

§

impl<W> UnwindSafe for ParLasZipCompressor<W>
where W: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.