macro_rules! bind_executor {
($executor:ty) => { ... };
}Expand description
Writes the Connection impl for a concrete Rainier ORM Executor.
ⓘ
struct MyExecutor { /* … */ }
impl rainier_orm::Executor for MyExecutor { /* … */ }
rainier_database::bind_executor!(MyExecutor);Two constraints, both worth knowing before you reach for this:
- The type must be concrete. Rust cannot prove a generic
E: ExecutorhasSendfutures — that needs return-type notation, still unstable — whereas for a named type the auto traits leak out of theasync fnbodies and the compiler works it out. - The type must be yours.
Connectionis defined here, so the orphan rule allows the impl only in this crate or in the crate defining the executor. An application therefore cannot bind an executor it did not write; the ones Rainier ORM ships are bound below, behind the same feature flags Rainier ORM uses for them.