Skip to main content

Host

Trait Host 

Source
pub trait Host: Send {
    // Required methods
    fn query(
        &mut self,
        address: String,
        statement: String,
        params: Vec<ParameterValue>,
    ) -> impl Future<Output = Result<RowSet, MysqlError>> + Send;
    fn execute(
        &mut self,
        address: String,
        statement: String,
        params: Vec<ParameterValue>,
    ) -> impl Future<Output = Result<(), MysqlError>> + Send;
    fn convert_mysql_error(&mut self, err: MysqlError) -> Result<MysqlError>;
}

Required Methods§

Source

fn query( &mut self, address: String, statement: String, params: Vec<ParameterValue>, ) -> impl Future<Output = Result<RowSet, MysqlError>> + Send

query the database: select

Source

fn execute( &mut self, address: String, statement: String, params: Vec<ParameterValue>, ) -> impl Future<Output = Result<(), MysqlError>> + Send

execute command to the database: insert, update, delete

Source

fn convert_mysql_error(&mut self, err: MysqlError) -> Result<MysqlError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<_T: Host + ?Sized + Send> Host for &mut _T

Source§

fn query( &mut self, address: String, statement: String, params: Vec<ParameterValue>, ) -> impl Future<Output = Result<RowSet, MysqlError>> + Send

query the database: select

Source§

fn execute( &mut self, address: String, statement: String, params: Vec<ParameterValue>, ) -> impl Future<Output = Result<(), MysqlError>> + Send

execute command to the database: insert, update, delete

Source§

fn convert_mysql_error(&mut self, err: MysqlError) -> Result<MysqlError>

Implementors§