Skip to main content

client

Macro client 

Source
macro_rules! client {
    ($($model:ident),+ $(,)?) => { ... };
}
Expand description

Attach per-model accessors to PraxClient<E>.

Each identifier must name a model declared via #[derive(Model)] or prax_schema!. For each Foo the macro emits a sealed extension trait PraxClientExt with fn foo(&self) -> foo::Client<E> and implements it for PraxClient<E>.

The extension-trait detour exists because Rust’s orphan rule bans downstream crates from writing inherent impl blocks for types they do not own — callers use PraxClient from prax_orm, so they must go through a trait. The PraxClientExt name is fixed; the trait is brought into scope at the call site by the macro.