ReferenceRust API
Rust API
Rent's everyday API is generated from the application's RSL schema. Names in the examples below, such as user(),
create_post(), email_eq(), and with_comments(), come from your entities and fields.
| Area | Entry point | Use it for |
|---|---|---|
| Generated client | generated::client::Client | Queries, mutations, transactions, and middleware |
| Models | generated::user::User | Typed rows and loaded relationships |
| Fields | generated::user::fields | Ordering, projection, and upsert conflict targets |
| Predicates | generated::user_predicate | Reusable or dynamic boolean expressions |
| Runtime | rent::runtime | Context, cursors, codecs, hooks, retry policies, and errors |
| Driver | rent::driver | Pools, pool options, dialects, and transaction options |
| Schema | rent/schema.rsl and rent validate | Models, fields, constraints, and relationships |
| Migrations | rent::migrate | Catalogs, semantic plans, inspection, and rendering |
| Extensions | rent::extension | PostgreSQL extension manifests and typed registration |
Most application code needs only a generated Client. Open the focused guides for
queries, mutations,
transactions, schema attributes, and
errors.
Generated Rust documentation
Every generated model, query builder, relationship accessor, and inspection method carries Rust documentation. Build the API reference for your application with the normal Rust toolchain:
cargo doc --no-deps --openThe generated modules are ordinary Rust modules, so editor hover help and local rustdoc always describe the exact
entities and methods present in your schema. Run rent generate first whenever the schema changes.