Trait Query

Source
pub trait Query {
    // Required method
    fn _send_encode_query<S>(
        &self,
        stmt: S,
    ) -> Result<(S::Output, Response), Error>
       where S: Encode;

    // Provided method
    fn _query<S>(
        &self,
        stmt: S,
    ) -> Result<<S::Output as IntoResponse>::Response, Error>
       where S: Encode { ... }
}
Expand description

trait generic over api used for querying with typed prepared statement.

types like Transaction and CopyIn accept generic client type and they are able to use user supplied client new type to operate and therefore reduce less new types and methods boilerplate.

Required Methods§

Source

fn _send_encode_query<S>(&self, stmt: S) -> Result<(S::Output, Response), Error>
where S: Encode,

encode statement and params and send it to client driver

Provided Methods§

Source

fn _query<S>( &self, stmt: S, ) -> Result<<S::Output as IntoResponse>::Response, Error>
where S: Encode,

query with statement and dynamic typed params.

statement must be a type impl Encode trait

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.

Implementations on Foreign Types§

Source§

impl Query for Arc<Client>

Source§

fn _send_encode_query<S>(&self, stmt: S) -> Result<(S::Output, Response), Error>
where S: Encode,

Implementors§