Crates.io | limiting-factor-core |
lib.rs | limiting-factor-core |
version | 1.0.0 |
created_at | 2025-09-24 18:04:50.38287+00 |
updated_at | 2025-09-24 18:04:50.38287+00 |
description | Library to create a REST API with web frameworks |
homepage | |
repository | https://devcentral.nasqueron.org/source/limiting-factor/ |
max_upload_size | |
id | 1853515 |
size | 11,143 |
The limiting-factor crate offers facilities to implement a REST API.
The goal of this library is to provide:
That allows an API or a back-end web server to focus on requests and data model, and to maintain helper methods as a separate library.
The library core features rely on:
If you need PostgreSQL support:
Currently, we provide and support only limiting-factor
crate for Rocket 0.4.
We're also working on a new crate to ease migration from Rocket to Axum.
The exact crate to use depends on your framework:
Framework | Crate name | To build with |
---|---|---|
Axum | limiting-factor-axum | stable or nightly |
Rocket 0.3 | limiting-factor v0.5.1 | (1) |
Rocket 0.4 | limiting-factor v0.8.0 | nightly-2024-12-15 |
Rocket 0.5 | - | not yet supported. |
(1) Build of Rocket 0.3 seems to be tricky and require custom dependencies: rocket v0.3.16 or v0.3.17 -> cookie v0.9.1 -> ring v0.11.0, a yanked crate
If you want to target Rocket before 0.5, you need a nightly toolchain.
Stable toolchain will work for other crates.
You need to give to rustc
some hints about where libpq.lib
is.
The pq-sys crate offers a build script to find the library and then print the relevant hints.
You can manually set your PostgreSQL library folder with:
export PQ_LIB_DIR="C:\Program Files\PostgreSQL\13\lib"
cargo run
The glue code to use Rocket with Diesel is adapted from Rocket v0.3 guide. See https://rocket.rs/guide/v0.3/state/#databases.
Guide author: Sergio Benitez.