Trait StatementWithInput

Source
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§

Source

type Input: Send

Input for the statement.

Source

type Output: Send

Output of the statement.

Required Methods§

Source

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.

Source

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.

Source

fn execute_async<S: SqlExecutorAsync>( self, connection: &mut S, input: Self::Input, ) -> impl Future<Output = Result<Self::Output, S::Error>> + Send

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.

Implementors§