Convert self into an async stream ``` # use sea_orm::{error::*, tests_cfg::*, *}; # # #[smol_potat::main] # #[cfg(feature = "mock")] # pub async fn main() -> Result<(), DbErr> { # # let owned_db = MockDatabase::new(DbBackend::Postgres) # .append_query_results([ # vec![cake::Model { # id: 1, # name: "Cake".to_owned(), # }], # vec![], # ]) #
(mut self)
| 198 | /// # } |
| 199 | /// ``` |
| 200 | pub fn into_stream(mut self) -> PinBoxStream<'db, Result<Vec<S::Item>, DbErr>> { |
| 201 | Box::pin(stream! { |
| 202 | while let Some(vec) = self.fetch_and_next().await? { |
| 203 | yield Ok(vec); |
| 204 | } |
| 205 | }) |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | #[async_trait::async_trait] |
no outgoing calls
no test coverage detected