pub trait HostConnection: Sized + Send {
// Required methods
fn open(
&mut self,
database: String,
) -> impl Future<Output = Result<Resource<Connection>, Error>> + Send;
fn execute(
&mut self,
self_: Resource<Connection>,
statement: String,
parameters: Vec<Value>,
) -> impl Future<Output = Result<QueryResult, Error>> + Send;
fn drop(
&mut self,
rep: Resource<Connection>,
) -> impl Future<Output = Result<()>> + Send;
}
Required Methods§
Sourcefn open(
&mut self,
database: String,
) -> impl Future<Output = Result<Resource<Connection>, Error>> + Send
fn open( &mut self, database: String, ) -> impl Future<Output = Result<Resource<Connection>, Error>> + Send
Open a connection to a named database instance.
If database
is “default”, the default instance is opened.
error::no-such-database
will be raised if the name
is not recognized.
Sourcefn execute(
&mut self,
self_: Resource<Connection>,
statement: String,
parameters: Vec<Value>,
) -> impl Future<Output = Result<QueryResult, Error>> + Send
fn execute( &mut self, self_: Resource<Connection>, statement: String, parameters: Vec<Value>, ) -> impl Future<Output = Result<QueryResult, Error>> + Send
Execute a statement returning back data if there is any
fn drop( &mut self, rep: Resource<Connection>, ) -> impl Future<Output = Result<()>> + Send
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<_T: HostConnection + ?Sized + Send> HostConnection for &mut _T
impl<_T: HostConnection + ?Sized + Send> HostConnection for &mut _T
Source§async fn open(
&mut self,
database: String,
) -> Result<Resource<Connection>, Error>
async fn open( &mut self, database: String, ) -> Result<Resource<Connection>, Error>
Open a connection to a named database instance.
If database
is “default”, the default instance is opened.
error::no-such-database
will be raised if the name
is not recognized.
Source§async fn execute(
&mut self,
self_: Resource<Connection>,
statement: String,
parameters: Vec<Value>,
) -> Result<QueryResult, Error>
async fn execute( &mut self, self_: Resource<Connection>, statement: String, parameters: Vec<Value>, ) -> Result<QueryResult, Error>
Execute a statement returning back data if there is any