Trait StreamTrait
pub trait StreamTrait: Send + Sync {
type Stream<'a>: Stream<Item = Result<QueryResult, DbErr>> + Send
where Self: 'a;
// Required methods
fn get_database_backend(&self) -> DbBackend;
fn get_schema(&self) -> Option<&str>;
fn stream_raw<'a>(
&'a self,
stmt: Statement,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<'a>, DbErr>> + Send + 'a>>;
// Provided method
fn stream<'a, S: StatementBuilder>(
&'a self,
stmt: &S,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<'a>, DbErr>> + Send + 'a>> { ... }
}Expand description
Stream query results
Required Associated Types§
type Stream<'a>: Stream<Item = Result<QueryResult, DbErr>> + Send
where
Self: 'a
type Stream<'a>: Stream<Item = Result<QueryResult, DbErr>> + Send where Self: 'a
Create a stream for the QueryResult
Required Methods§
fn get_database_backend(&self) -> DbBackend
fn get_database_backend(&self) -> DbBackend
Get the database backend for the connection. This depends on feature flags enabled.
fn get_schema(&self) -> Option<&str>
fn get_schema(&self) -> Option<&str>
For MSSQL only. Get database schema that specified in the connection string
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.