Trait typed_sql::fetch::Fetch

source ·
pub trait Fetch<'c, 'out, E>: ToSql + CheckedSqlwhere
    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>>

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>,

§

type Output = <S as Selectable>::Table