pub trait StatementWithInput: Send {
type Input: Send;
type Output: Send;
// Required methods
fn execute<S: SqlExecutor>(
self,
connection: &S,
input: Self::Input,
) -> Result<Self::Output, S::Error>;
fn execute_mut<S: SqlExecutorMut>(
self,
connection: &mut S,
input: Self::Input,
) -> Result<Self::Output, S::Error>;
fn execute_async<S: SqlExecutorAsync>(
self,
connection: &mut S,
input: Self::Input,
) -> impl Future<Output = Result<Self::Output, S::Error>> + Send;
}
Expand description
Similar to Statement
but accepts an input parameter.
This statement is intended to be used with Statement::pipe
.
Required Associated Types§
Required Methods§
Sourcefn execute<S: SqlExecutor>(
self,
connection: &S,
input: Self::Input,
) -> Result<Self::Output, S::Error>
fn execute<S: SqlExecutor>( self, connection: &S, input: Self::Input, ) -> Result<Self::Output, S::Error>
Execute the statement with the given input
and return the result.
§Errors
If the statement fails, return error.
Sourcefn execute_mut<S: SqlExecutorMut>(
self,
connection: &mut S,
input: Self::Input,
) -> Result<Self::Output, S::Error>
fn execute_mut<S: SqlExecutorMut>( self, connection: &mut S, input: Self::Input, ) -> Result<Self::Output, S::Error>
Execute the statement with the given input
and return the result.
§Errors
If the statement fails, return error.
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.