pub trait ValuesBuffer {
// Required methods
fn with_capacity(capacity: usize) -> Self;
fn pad_nulls(
&mut self,
read_offset: usize,
values_read: usize,
levels_read: usize,
valid_mask: &[u8],
);
}Expand description
A buffer that supports padding with nulls
Required Methods§
Sourcefn with_capacity(capacity: usize) -> Self
fn with_capacity(capacity: usize) -> Self
Create a new buffer with capacity for at least capacity elements
This allows pre-allocating buffers to avoid reallocations during reading, improving performance when the number of values is known in advance.
Sourcefn pad_nulls(
&mut self,
read_offset: usize,
values_read: usize,
levels_read: usize,
valid_mask: &[u8],
)
fn pad_nulls( &mut self, read_offset: usize, values_read: usize, levels_read: usize, valid_mask: &[u8], )
If a column contains nulls, more level data may be read than value data, as null
values are not encoded. Therefore, first the levels data is read, the null count
determined, and then the corresponding number of values read to a ValuesBuffer.
It is then necessary to move this values data into positions that correspond to the non-null level positions. This is what this method does.
It is provided with:
read_offset- the offset inValuesBufferto start null padding fromvalues_read- the number of values readlevels_read- the number of levels readvalid_mask- a packed mask of valid levels
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.