Trait diesel_async::methods::LoadQuery

source ·
pub trait LoadQuery<'query, Conn: AsyncConnection, U> {
    type LoadFuture<'conn>: Future<Output = QueryResult<Self::Stream<'conn>>> + Send
       where Conn: 'conn;
    type Stream<'conn>: Stream<Item = QueryResult<U>> + Send
       where Conn: 'conn;

    // Required method
    fn internal_load(self, conn: &mut Conn) -> Self::LoadFuture<'_>;
}
Expand description

The load method

This trait should not be relied on directly by most apps. Its behavior is provided by RunQueryDsl. However, you may need a where clause on this trait to call load from generic code.

Required Associated Types§

source

type LoadFuture<'conn>: Future<Output = QueryResult<Self::Stream<'conn>>> + Send where Conn: 'conn

The future returned by LoadQuery::internal_load

source

type Stream<'conn>: Stream<Item = QueryResult<U>> + Send where Conn: 'conn

The inner stream returned by LoadQuery::internal_load

Required Methods§

source

fn internal_load(self, conn: &mut Conn) -> Self::LoadFuture<'_>

Load this query

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'query, Conn, DB, T, U, ST> LoadQuery<'query, Conn, U> for T
where Conn: AsyncConnection<Backend = DB>, U: Send + FromSqlRow<ST, DB> + 'static, DB: Backend + 'static + QueryMetadata<T::SqlType>, T: AsQuery + Send + 'query, T::Query: QueryFragment<DB> + QueryId + Send + 'query, T::SqlType: CompatibleType<U, DB, SqlType = ST>, ST: 'static,

§

type LoadFuture<'conn> = MapOk<<Conn as AsyncConnection>::LoadFuture<'conn, 'query>, fn(_: <Conn as AsyncConnection>::Stream<'conn, 'query>) -> <T as LoadQuery<'query, Conn, U>>::Stream<'conn>> where Conn: 'conn

§

type Stream<'conn> = Map<<Conn as AsyncConnection>::Stream<'conn, 'query>, fn(_: Result<<Conn as AsyncConnection>::Row<'conn, 'query>, Error>) -> Result<U, Error>> where Conn: 'conn