Trait Executable

Source
pub trait Executable {
    type Output;

    // Required method
    fn exec_with<'life0, 'async_trait>(
        &'life0 self,
        client: impl 'async_trait + Executor + Send + Sync,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn exec<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: '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_with<'life0, 'async_trait>( &'life0 self, client: impl 'async_trait + Executor + Send + Sync, ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute the query given any viable Executor

Provided Methods§

Source

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

The actual function for executing a 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<'a> Executable for Query<'a, u64>

Source§

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

Source§

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