Trait Fetch

Source
pub trait Fetch<'c, 'out, E>: ToSql + CheckedSql
where E: Executor<'c> + 'out,
{ type Output: for<'r> FromRow<'r, <E::Database as Database>::Row>; // Provided methods fn fetch_one( &self, exec: E, ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Error>> + Send + 'out>> { ... } fn fetch_optional( &self, exec: E, ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Output>, Error>> + Send + 'out>> { ... } }

Required Associated Types§

Source

type Output: for<'r> FromRow<'r, <E::Database as Database>::Row>

Provided Methods§

Source

fn fetch_one( &self, exec: E, ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Error>> + Send + 'out>>

Source

fn fetch_optional( &self, exec: E, ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Output>, Error>> + Send + 'out>>

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<'c, 'out, E, S> Fetch<'c, 'out, E> for SelectStatement<S, WildCard>
where E: Executor<'c> + 'out, S: Selectable, S::Table: for<'r> FromRow<'r, <E::Database as Database>::Row>,