Trait diesel::connection::LoadConnection
source · pub trait LoadConnection<B = DefaultLoadingMode>: Connectionwhere
for<'conn, 'query> Self: ConnectionGatWorkaround<'conn, 'query, Self::Backend, B>,{
// Required method
fn load<'conn, 'query, T>(
&'conn mut self,
source: T,
) -> QueryResult<LoadRowIter<'conn, 'query, Self, Self::Backend, B>>
where T: Query + QueryFragment<Self::Backend> + QueryId + 'query,
Self::Backend: QueryMetadata<T::SqlType>;
}
Expand description
The specific part of a Connection
which actually loads data from the database
This is a separate trait to allow connection implementations to specify different loading modes via the generic paramater.
Required Methods§
sourcefn load<'conn, 'query, T>(
&'conn mut self,
source: T,
) -> QueryResult<LoadRowIter<'conn, 'query, Self, Self::Backend, B>>where
T: Query + QueryFragment<Self::Backend> + QueryId + 'query,
Self::Backend: QueryMetadata<T::SqlType>,
fn load<'conn, 'query, T>(
&'conn mut self,
source: T,
) -> QueryResult<LoadRowIter<'conn, 'query, Self, Self::Backend, B>>where
T: Query + QueryFragment<Self::Backend> + QueryId + 'query,
Self::Backend: QueryMetadata<T::SqlType>,
Executes a given query and returns any requested values
This function executes a given query and returns the
query result as given by the database. Normal users
should not use this function. Use
QueryDsl::load
instead.
This function is useful for people trying to build an alternative
dsl on top of diesel. It returns an LoadRowIter
, which
is essentially an Iterator<Item = QueryResult<&impl Row<Self::Backend>>
.
This type can be used to iterate over all rows returned by the database.
Object Safety§
This trait is not object safe.