pub trait AsyncMysqlShim<W: Send> {
    type Error: From<Error>;

    fn on_prepare<'a, 'async_trait>(
        &'a mut self,
        query: &'a str,
        info: StatementMetaWriter<'a, W>
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
    where
        'a: 'async_trait,
        Self: 'async_trait
; fn on_execute<'a, 'async_trait>(
        &'a mut self,
        id: u32,
        params: ParamParser<'a>,
        results: QueryResultWriter<'a, W>
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
    where
        'a: 'async_trait,
        Self: 'async_trait
; fn on_close<'a, 'async_trait>(
        &'a mut self,
        stmt: u32
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        W: 'async_trait,
        'a: 'async_trait,
        Self: 'async_trait
; fn on_query<'a, 'async_trait>(
        &'a mut self,
        query: &'a str,
        results: QueryResultWriter<'a, W>
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
    where
        'a: 'async_trait,
        Self: 'async_trait
; fn version(&self) -> &str { ... } fn connect_id(&self) -> u32 { ... } fn default_auth_plugin(&self) -> &str { ... } fn auth_plugin_for_username<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _user: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = &'_ str> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... } fn salt(&self) -> [u8; 20] { ... } fn authenticate<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        _auth_plugin: &'life1 str,
        _username: &'life2 [u8],
        _salt: &'life3 [u8],
        _auth_data: &'life4 [u8]
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        'life4: 'async_trait,
        Self: Sync + 'async_trait
, { ... } fn on_init<'a, 'async_trait>(
        &'a mut self,
        __arg1: &'a str,
        __arg2: InitWriter<'a, W>
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
    where
        'a: 'async_trait,
        Self: Send + 'async_trait
, { ... } }
Expand description

Implementors of this async-trait can be used to drive a MySQL-compatible database backend.

Required Associated Types§

The error type produced by operations on this shim.

Must implement From<io::Error> so that transport-level errors can be lifted.

Required Methods§

Called when the client issues a request to prepare query for later execution.

The provided StatementMetaWriter should be used to notify the client of the statement id assigned to the prepared statement, as well as to give metadata about the types of parameters and returned columns.

Called when the client executes a previously prepared statement.

Any parameters included with the client’s command is given in params. A response to the query should be given using the provided QueryResultWriter.

Called when the client wishes to deallocate resources associated with a previously prepared statement.

Called when the client issues a query for immediate execution.

Results should be returned using the given QueryResultWriter.

Provided Methods§

Server version

Connection id

get auth plugin

get auth plugin

Default salt(scramble) for auth plugin

authenticate method for the specified plugin

Called when client switches database.

Implementors§