Skip to content
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
Columnsgenerated::user::User::emailFilters, ordering, and projection
Unique keysgenerated::user::unique::emailUpsert conflict targets, one per declared primary key or unique constraint
Predicatesgenerated::user::UserPredicateReusable or dynamic boolean expressions built from column tokens
Permissions (optional)PostPermission, client.post_permissions(&post_id)Named query requirements, typed grants, row flags, reverse inspection and explanations
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, permissions, 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.