rent
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.

AreaEntry pointUse it for
Generated clientgenerated::client::ClientQueries, mutations, transactions, and middleware
Modelsgenerated::user::UserTyped rows and loaded relationships
Fieldsgenerated::user::fieldsOrdering, projection, and upsert conflict targets
Predicatesgenerated::user_predicateReusable or dynamic boolean expressions
Runtimerent::runtimeContext, cursors, codecs, hooks, retry policies, and errors
Driverrent::driverPools, pool options, dialects, and transaction options
Schemarent/schema.rsl and rent validateModels, fields, constraints, and relationships
Migrationsrent::migrateCatalogs, semantic plans, inspection, and rendering
Extensionsrent::extensionPostgreSQL 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 --open

The 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.

On this page