pub struct StringColumn { /* private fields */ }Expand description
A column of strings: the views, and the blocks the long ones live in.
Blocks are append only and never move, so an offset recorded in a view stays correct for the
life of the column. Pushing a string longer than a block gives it a block of its own rather
than splitting it, which keeps every string contiguous and keeps Self::get free of a
stitching path that would be wrong more often than it ran.
Implementations§
Source§impl StringColumn
impl StringColumn
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
An empty column with room for capacity strings.
Sourcepub fn views(&self) -> &[StringView]
pub fn views(&self) -> &[StringView]
The views, for a kernel that wants to compare prefixes without reading any payload.
Sourcepub fn bytes(&self, index: usize) -> Option<&[u8]>
pub fn bytes(&self, index: usize) -> Option<&[u8]>
The bytes at index, or None past the end.
This is what a comparison, a hash and an equality check all actually want, and it is worth
having separately from Self::get because that one validates UTF-8 and they do not need
it. Everything in a column arrived through Self::push, which takes a &str, so the
bytes are valid either way and the validation is a scan of the payload that changes no
answer. On a varchar filter it was measured at most of the per row cost.
Sourcepub fn heap_bytes(&self) -> usize
pub fn heap_bytes(&self) -> usize
Total bytes of payload held in blocks, which is what the memory accounting wants.
Trait Implementations§
Source§impl Clone for StringColumn
impl Clone for StringColumn
Source§fn clone(&self) -> StringColumn
fn clone(&self) -> StringColumn
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StringColumn
impl Debug for StringColumn
Source§impl Default for StringColumn
impl Default for StringColumn
Source§fn default() -> StringColumn
fn default() -> StringColumn
impl Eq for StringColumn
Source§impl<'a> Extend<&'a str> for StringColumn
impl<'a> Extend<&'a str> for StringColumn
Source§fn extend<T: IntoIterator<Item = &'a str>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = &'a str>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)