Skip to main content

Query

Trait Query 

Source
pub trait Query<'s>: Parameters<'s> {
    type Output;

    // Required methods
    fn prepare(connection: &Connection) -> Result<Statement<'_>>;
    fn output<'c: 's>(execution: Execution<'c, 's>) -> Result<Self::Output>;
}
Expand description

A SQL query which can prepare itself into a Statement, bind itself as Parameters to the statement (if any), and read any desired output from the statement execution.

Required Associated Types§

Required Methods§

Source

fn prepare(connection: &Connection) -> Result<Statement<'_>>

Prepare a Statement to execute the Query.

Source

fn output<'c: 's>(execution: Execution<'c, 's>) -> Result<Self::Output>

Fetch the desired Query output from the Statement.

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§