pub unsafe trait ColumnBuffer: CDataMut {
type View<'a>
where Self: 'a;
// Required methods
fn view(&self, valid_rows: usize) -> Self::View<'_>;
fn fill_default(&mut self, from: usize, to: usize);
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
Views must not allow access to unintialized / invalid rows.
Required Associated Types§
Required Methods§
Sourcefn view(&self, valid_rows: usize) -> Self::View<'_>
fn view(&self, valid_rows: usize) -> Self::View<'_>
Num rows may not exceed the actual amount of valid num_rows filled by the ODBC API. The column buffer does not know how many elements were in the last row group, and therefore can not guarantee the accessed element to be valid and in a defined state. It also can not panic on accessing an undefined element.
Sourcefn fill_default(&mut self, from: usize, to: usize)
fn fill_default(&mut self, from: usize, to: usize)
Fills the column with the default representation of values, between from
and to
index.
Sourcefn has_truncated_values(&self, num_rows: usize) -> Option<Indicator>
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.