Rindle docs and package mapSkip to main content

SqliteRowStream

Struct SqliteRowStream 

Source
pub struct SqliteRowStream<'s> { /* private fields */ }
Expand description

The leaf row stream: a live rusqlite cursor (Rows) plus the per-column type tags. Implements the foundations lending [RowStream]; each next_row reborrows self, so the returned SqliteRow is invalidated by the next call — the SQLite cursor contract, now a compile-time invariant.

's is the lifetime of the prepared statement the cursor borrows. The statement is owned elsewhere (the caller / a pool), which sidesteps the self-referential-struct problem (05 §13 Q1): a field borrowing another field of the same struct is not expressible in safe Rust, so the statement lives outside and the stream borrows it for 's.

Field order is load-bearing: rows (the cursor) is declared before _guard so it drops first — the cursor is released before the “returned to pool” guard fires.

Implementations§

Source§

impl<'s> SqliteRowStream<'s>

Source

pub fn new(rows: Rows<'s>, types: &'s [ColType]) -> SqliteRowStream<'s>

Wrap a rusqlite::Rows cursor (from stmt.query(params)) and its column type tags.

Source

pub fn guarded( rows: Rows<'s>, types: &'s [ColType], guard: StmtGuard, ) -> SqliteRowStream<'s>

Same, but with a Primitive-#2 release guard (the open-cursor counter is decremented when this stream drops, including on early termination).

Source

pub fn take_error(&mut self) -> Option<SqliteError>

Re-raise the parked step error at the owning boundary. The node-stream / fetch layer calls this after the scan drains (where the result type is already fallible — 09); a leftover Some here means the scan hit a sqlite3_step error that must propagate, NOT a clean end-of-stream.

Trait Implementations§

Source§

impl<'s> RowStream for SqliteRowStream<'s>

Source§

type Row<'a> = SqliteRow<'a> where Self: 'a

Source§

fn next_row(&mut self) -> Option<Self::Row<'_>>

Auto Trait Implementations§

§

impl<'s> Freeze for SqliteRowStream<'s>

§

impl<'s> !RefUnwindSafe for SqliteRowStream<'s>

§

impl<'s> !Send for SqliteRowStream<'s>

§

impl<'s> !Sync for SqliteRowStream<'s>

§

impl<'s> Unpin for SqliteRowStream<'s>

§

impl<'s> UnsafeUnpin for SqliteRowStream<'s>

§

impl<'s> !UnwindSafe for SqliteRowStream<'s>

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,