diesel_async::methods

Trait 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

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.

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,

Source§

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

Source§

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