Skip to main content

BufferedVariableColumn

Struct BufferedVariableColumn 

Source
pub struct BufferedVariableColumn { /* private fields */ }
Expand description

An in-memory bulk-loaded selection of a VariableColumn’s rows (#168).

Produced by VariableColumn::gather_buffered; holds the column’s data bytes plus each selected slot’s (absolute offset, length) so read_string slices from memory without a syscall. The variable-column peer of BufferedFixedColumn: same read_string name as VariableColumn, addressed by slot (0..n over the selection order).

Implementations§

Source§

impl BufferedVariableColumn

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn read_str(&self, slot: usize) -> Result<&str, Error>

The slot’s value borrowed from the buffered span — no allocation, no copy (#224).

#222 made the span an mmap alias of the data region, so a scan already holds every live string’s bytes; this is the read that stops copying them back out. The borrow is tied to &self and the mapping is owned by self, so the compiler guarantees the &str cannot outlive the pages it points at — a tighter constraint than the type already operates under, not a new aliasing exposure.

UTF-8 is validated on every read (cheap next to the allocation it replaces) so an on-disk corruption surfaces as io::ErrorKind::InvalidData rather than as an unchecked &str.

Source

pub fn read_string(&self, slot: usize) -> Result<String, Error>

The slot’s value as an owned String. Kept for callers that genuinely need ownership; it is read_str plus the copy, so there is one decode path and the two can never disagree.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.