QueryStrategy

Trait QueryStrategy 

Source
pub trait QueryStrategy: QueryStrategyResult + QueryStrategyImpl { }
Expand description

Define how a query is sent to and results retrieved from the database.

This trait is implemented on the following unit structs:

  • Nothing retrieves nothing
  • Optional retrieves an optional row
  • One retrieves a single row
  • Stream retrieves many rows in a stream
  • All retrieves many rows in a vector
  • AffectedRows returns the number of rows affected by the query

This trait has an associated Result<'result> type which is returned by Executor::execute. To avoid boxing, these types are quite big.

Each of those unit structs’ docs (follow links above) contains an easy to read impl Trait version of the actual types.

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§