Registry / web-framework / rocket-contrib

rocket-contrib

JSON →
library0.4.11rscratesunverified

Community contributed libraries for the Rocket web framework.

# Cargo.toml [dependencies] rocket_contrib = "0.4.11"
INSTALL
IMPORT
SIG · ROCKET-CONTRIB
R
rocket-contrib
web-frameworkrustv0.4.11
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PgConnection
use rocket_contrib::databases::diesel::PgConnection;

Use Diesel database connection with Rocket.

#[macro_use] extern crate rocket; use rocket_contrib::databases::diesel; #[database("pg_db")] struct DbConn(diesel::PgConnection); #[get("/")] fn index(conn: DbConn) -> String { format!("Connected to database") } fn main() { rocket::ignite().mount("/", routes![index]).launch(); }
Debug
Known issues
breakingDeprecated in favor of Rocket's built-in database support in version 0.5+.
fix
Migrate to Rocket 0.5+ and use `rocket_db_pools` or `rocket_sync_db_pools`.
affects: >=0.5.0
Upgrade
Version history
0.4.11latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
rocket-contrib — cargo add rocket-contrib · libregistry