Trait opensrv_mysql::AsyncMysqlShim
source · [−]pub trait AsyncMysqlShim<W: Write + 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
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.
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_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,
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
fn connect_id(&self) -> u32
fn connect_id(&self) -> u32
Connection id
fn default_auth_plugin(&self) -> &str
fn default_auth_plugin(&self) -> &str
get auth plugin
get auth plugin
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 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,
authenticate method for the specified plugin