Skip to main content

StreamTrait

Trait StreamTrait 

Source
pub trait StreamTrait: Send + Sync {
    // Required method
    fn stream<'a>(
        &'a self,
        statement: Statement,
    ) -> Pin<Box<dyn Future<Output = Result<RowStream<'a>>> + Send + 'a>>;
}
Expand description

Streams rows lazily.

Required Methods§

Source

fn stream<'a>( &'a self, statement: Statement, ) -> Pin<Box<dyn Future<Output = Result<RowStream<'a>>> + Send + 'a>>

Runs a query and streams its rows.

§Errors

The future fails with Error::Turso when the statement cannot be prepared or started, and the Database implementation with Error::PoolTimeout when no connection is free. Errors while stepping are yielded as items of the stream.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§