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(positionalpread) — 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
impl FixedColumnReader
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn read_u32(&self, index: usize) -> Result<u32, Error>
pub fn read_u64(&self, index: usize) -> Result<u64, Error>
pub fn read_i32(&self, index: usize) -> Result<i32, Error>
pub fn read_i64(&self, index: usize) -> Result<i64, Error>
pub fn read_f64(&self, index: usize) -> Result<f64, Error>
pub fn read_bool(&self, index: usize) -> Result<bool, Error>
pub fn read_uuid(&self, index: usize) -> Result<[u8; 16], Error>
pub fn read_timestamp(&self, index: usize) -> Result<i64, Error>
pub fn read_bytes(&self, index: usize) -> Result<Vec<u8>, Error>
Auto Trait Implementations§
impl Freeze for FixedColumnReader
impl RefUnwindSafe for FixedColumnReader
impl Send for FixedColumnReader
impl Sync for FixedColumnReader
impl Unpin for FixedColumnReader
impl UnsafeUnpin for FixedColumnReader
impl UnwindSafe for FixedColumnReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more