OwningBuffer

Trait OwningBuffer 

Source
pub trait OwningBuffer<'a>: BorrowedMutBuffer<'a> {
    // Required methods
    unsafe fn push_points(&mut self, point_bytes: &[u8]);
    fn resize(&mut self, count: usize);
    fn clear(&mut self);
}
Expand description

Trait for point buffers that own their memory. Compared to BorrowedMutBuffer, buffers that implement this trait support the following additional capabilities:

  • Pushing point data into the buffer using push_points
  • Appending other buffers to the end of this buffer using append, append_interleaved, and append_columnar
  • Resizing and clearing the contents of the buffer using resize and clear

Required Methods§

Source

unsafe fn push_points(&mut self, point_bytes: &[u8])

Push the raw memory for a range of points into this buffer. Works similar to Vec::push

§Safety

point_bytes must contain the raw memory for a whole number of points in the PointLayout of this buffer. This property is not checked at runtime, so this function is very unsafe!

§Panics

May panic if point_bytes.len() is not a multiple of self.point_layout().size_of_point_record()

Source

fn resize(&mut self, count: usize)

Resize this buffer to contain exactly count points. If count is less than self.len(), point data is removed, if count is greater than self.len() new points are default-constructed (i.e. zero-initialized).

Source

fn clear(&mut self)

Clears the contents of this buffer, removing all point data and setting the length to 0

Trait Implementations§

Source§

impl<'a> OwningBufferExt<'a> for dyn OwningBuffer<'a> + 'a

Source§

fn append<'b, B: BorrowedBuffer<'b> + ?Sized>(&mut self, other: &B)

Appends data from the given buffer to the end of this buffer Read more

Implementors§