Skip to main content

Executor

Trait Executor 

Source
pub trait Executor {
    type T: Database;

Show 14 methods // Required methods async fn new(url: &str) -> Self where Self: Sized; fn db<'q>(&'q self) -> &'q Pool<Self::T>; fn to_sql<'q>( &self, statement: &'q Statement<'q, Self::T>, ) -> Result<String>; async fn execute<'q>(&self, sql: &'q str) -> Result<()>; async fn insert<'q>( &self, statement: &'q Statement<'q, Self::T>, ) -> Result<()>; async fn update<'q>( &self, statement: &'q Statement<'q, Self::T>, ) -> Result<()>; async fn count<'q>( &self, statement: &'q Statement<'q, Self::T>, ) -> Result<u64>; async fn delete<'q>( &self, statement: &'q Statement<'q, Self::T>, ) -> Result<()>; async fn insert_as<'q, O>( &self, statement: &'q Statement<'q, Self::T>, ) -> Result<O> where O: for<'r> FromRow<'r, <Self::T as Database>::Row> + Send + Unpin + Sized; async fn query_all<'q, O, T: 'q + Encode<'q, Self::T> + Type<Self::T>>( &self, sql: &str, args: Vec<T>, ) -> Result<Vec<O>> where O: for<'r> FromRow<'r, <Self::T as Database>::Row> + Send + Unpin + Sized; async fn query_one<'q, O, T: 'q + Encode<'q, Self::T> + Type<Self::T>>( &self, sql: &str, args: Vec<T>, ) -> Result<O> where O: for<'r> FromRow<'r, <Self::T as Database>::Row> + Send + Unpin + Sized; async fn all<'q, O>( &self, statement: &'q Statement<'q, Self::T>, ) -> Result<Vec<O>> where O: for<'r> FromRow<'r, <Self::T as Database>::Row> + Send + Unpin + Sized; async fn first<'q, O>( &self, statement: &'q Statement<'q, Self::T>, ) -> Result<O> where O: for<'r> FromRow<'r, <Self::T as Database>::Row> + Send + Unpin + Sized; async fn paginate<'q, O>( &self, statement: &'q Statement<'q, Self::T>, ) -> Result<Pagination<O>> where O: for<'r> FromRow<'r, <Self::T as Database>::Row> + Send + Unpin + Sized;
}

Required Associated Types§

Required Methods§

Source

async fn new(url: &str) -> Self
where Self: Sized,

Source

fn db<'q>(&'q self) -> &'q Pool<Self::T>

Source

fn to_sql<'q>(&self, statement: &'q Statement<'q, Self::T>) -> Result<String>

Source

async fn execute<'q>(&self, sql: &'q str) -> Result<()>

Source

async fn insert<'q>(&self, statement: &'q Statement<'q, Self::T>) -> Result<()>

Source

async fn update<'q>(&self, statement: &'q Statement<'q, Self::T>) -> Result<()>

Source

async fn count<'q>(&self, statement: &'q Statement<'q, Self::T>) -> Result<u64>

Source

async fn delete<'q>(&self, statement: &'q Statement<'q, Self::T>) -> Result<()>

Source

async fn insert_as<'q, O>( &self, statement: &'q Statement<'q, Self::T>, ) -> Result<O>
where O: for<'r> FromRow<'r, <Self::T as Database>::Row> + Send + Unpin + Sized,

Source

async fn query_all<'q, O, T: 'q + Encode<'q, Self::T> + Type<Self::T>>( &self, sql: &str, args: Vec<T>, ) -> Result<Vec<O>>
where O: for<'r> FromRow<'r, <Self::T as Database>::Row> + Send + Unpin + Sized,

Source

async fn query_one<'q, O, T: 'q + Encode<'q, Self::T> + Type<Self::T>>( &self, sql: &str, args: Vec<T>, ) -> Result<O>
where O: for<'r> FromRow<'r, <Self::T as Database>::Row> + Send + Unpin + Sized,

Source

async fn all<'q, O>( &self, statement: &'q Statement<'q, Self::T>, ) -> Result<Vec<O>>
where O: for<'r> FromRow<'r, <Self::T as Database>::Row> + Send + Unpin + Sized,

Source

async fn first<'q, O>(&self, statement: &'q Statement<'q, Self::T>) -> Result<O>
where O: for<'r> FromRow<'r, <Self::T as Database>::Row> + Send + Unpin + Sized,

Source

async fn paginate<'q, O>( &self, statement: &'q Statement<'q, Self::T>, ) -> Result<Pagination<O>>
where O: for<'r> FromRow<'r, <Self::T as Database>::Row> + Send + Unpin + Sized,

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§