Skip to main content

FixedColumnReader

Struct FixedColumnReader 

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

Read-only, positional view over a FixedColumn’s backing file (#56 Direction B — single writer, many concurrent readers).

Created by FixedColumn::reader; holds an independent file descriptor (try_clone) to the same file as the writer. A single &mut self writer can keep appending while any number of &self readers positionally read the committed prefix concurrently, with no lock:

  • Reads use read_exact_at (positional pread) — they never touch a shared file cursor, so they are safe against a concurrent seek-based append and against each other across threads.
  • The engine is append-only: bytes at an already-committed offset never move, so a reader observing an offset below the writer’s committed length reads stable bytes (POSIX page-cache coherence makes the writer’s not-yet-fsync’d appends visible through this independent fd).
  • Length is derived live on every access (never a cached count), so a reader created before an append still sees rows the writer commits afterward — once the caller’s watermark admits them.

Callers clamp reads to a captured watermark (the row-count anchor); because the anchor column is appended last per row, a row within the watermark has all its columns fully written, so a reader never observes a torn row.

Implementations§

Source§

impl FixedColumnReader

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn read_u32(&self, index: usize) -> Result<u32, Error>

Source

pub fn read_u64(&self, index: usize) -> Result<u64, Error>

Source

pub fn read_i32(&self, index: usize) -> Result<i32, Error>

Source

pub fn read_i64(&self, index: usize) -> Result<i64, Error>

Source

pub fn read_f64(&self, index: usize) -> Result<f64, Error>

Source

pub fn read_bool(&self, index: usize) -> Result<bool, Error>

Source

pub fn read_uuid(&self, index: usize) -> Result<[u8; 16], Error>

Source

pub fn read_timestamp(&self, index: usize) -> Result<i64, Error>

Source

pub fn read_bytes(&self, index: usize) -> Result<Vec<u8>, Error>

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.