Skip to main content

ColumnBuffer

Trait ColumnBuffer 

Source
pub unsafe trait ColumnBuffer: CDataMut {
    // Required methods
    fn capacity(&self) -> usize;
    fn has_truncated_values(&self, num_rows: usize) -> Option<Indicator>;
}
Expand description

A buffer for a single column intended to be used together with ColumnarBuffer.

§Safety

Implementations must ensure that:

  • Capacity must be correctly reported otherwise data may be written outside its bounds.
  • truncation must be correctly reported. Code which reuses the same column buffer for reading and inserting may rely on this in order to avoid passing values indicators of truncated values in bulk insertions. This could lead to out of bounds memory access.

Required Methods§

Source

fn capacity(&self) -> usize

Current capacity of the column

Source

fn has_truncated_values(&self, num_rows: usize) -> Option<Indicator>

Some if any value is truncated in the range [0, num_rows).

After fetching data we may want to know if any value has been truncated due to the buffer not being able to hold elements of that size. This method checks the indicator buffer element wise.

Implementations on Foreign Types§

Source§

impl ColumnBuffer for Box<dyn AnyColumnBuffer>

Source§

impl<T> ColumnBuffer for Vec<T>
where T: Pod,

Implementors§