MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / into_stream

Method into_stream

src/executor/paginator.rs:200–206  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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]

Callers 4

into_streamFunction · 0.80
into_stream_rawFunction · 0.80
find_all_streamFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected