pub trait HostConnection: Send {
// Required methods
fn open(
&mut self,
address: String,
) -> impl Future<Output = Result<Resource<Connection>, Error>> + Send;
fn query(
&mut self,
self_: Resource<Connection>,
statement: String,
params: Vec<ParameterValue>,
) -> impl Future<Output = Result<RowSet, Error>> + Send;
fn execute(
&mut self,
self_: Resource<Connection>,
statement: String,
params: Vec<ParameterValue>,
) -> impl Future<Output = Result<u64, Error>> + Send;
fn drop(
&mut self,
rep: Resource<Connection>,
) -> impl Future<Output = Result<()>> + Send;
}Required Methods§
Sourcefn open(
&mut self,
address: String,
) -> impl Future<Output = Result<Resource<Connection>, Error>> + Send
fn open( &mut self, address: String, ) -> impl Future<Output = Result<Resource<Connection>, Error>> + Send
Open a connection to the Postgres instance at address.
Sourcefn query(
&mut self,
self_: Resource<Connection>,
statement: String,
params: Vec<ParameterValue>,
) -> impl Future<Output = Result<RowSet, Error>> + Send
fn query( &mut self, self_: Resource<Connection>, statement: String, params: Vec<ParameterValue>, ) -> impl Future<Output = Result<RowSet, Error>> + Send
Query the database.
Sourcefn execute(
&mut self,
self_: Resource<Connection>,
statement: String,
params: Vec<ParameterValue>,
) -> impl Future<Output = Result<u64, Error>> + Send
fn execute( &mut self, self_: Resource<Connection>, statement: String, params: Vec<ParameterValue>, ) -> impl Future<Output = Result<u64, Error>> + Send
Execute command to the database.
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".
Implementations on Foreign Types§
Source§impl<_T: HostConnection + ?Sized + Send> HostConnection for &mut _T
impl<_T: HostConnection + ?Sized + Send> HostConnection for &mut _T
Source§fn open(
&mut self,
address: String,
) -> impl Future<Output = Result<Resource<Connection>, Error>> + Send
fn open( &mut self, address: String, ) -> impl Future<Output = Result<Resource<Connection>, Error>> + Send
Open a connection to the Postgres instance at address.
Source§fn query(
&mut self,
self_: Resource<Connection>,
statement: String,
params: Vec<ParameterValue>,
) -> impl Future<Output = Result<RowSet, Error>> + Send
fn query( &mut self, self_: Resource<Connection>, statement: String, params: Vec<ParameterValue>, ) -> impl Future<Output = Result<RowSet, Error>> + Send
Query the database.
Source§fn execute(
&mut self,
self_: Resource<Connection>,
statement: String,
params: Vec<ParameterValue>,
) -> impl Future<Output = Result<u64, Error>> + Send
fn execute( &mut self, self_: Resource<Connection>, statement: String, params: Vec<ParameterValue>, ) -> impl Future<Output = Result<u64, Error>> + Send
Execute command to the database.