Trait pg_worm::query::Executable

source ·
pub trait Executable {
    type Output;

    // Required method
    fn exec<'async_trait>(
        self
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

Trait used to mark exectuable queries. It is used to make use of generics for executing them.

Required Associated Types§

source

type Output

What output should this query result in?

Required Methods§

source

fn exec<'async_trait>( self ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Error>> + Send + 'async_trait>>where Self: 'async_trait,

The actual function for executing a query.

Implementors§

source§

impl<'a> Executable for Query<'a, u64>

§

type Output = u64

source§

impl<'a, T> Executable for Query<'a, Option<T>>where T: TryFrom<Row, Error = Error> + Send,

§

type Output = Option<T>

source§

impl<'a, T> Executable for Query<'a, Vec<T>>where T: TryFrom<Row, Error = Error> + Send,

§

type Output = Vec<T, Global>