mirror of
https://github.com/rwf2/Rocket.git
synced 2024-12-31 23:02:37 +00:00
5a4e66ec43
This follows the completed graduation of stable contrib features into core, removing 'rocket_contrib' in its entirety in favor of two new crates. These crates are versioned independently of Rocket's core libraries, allowing upgrades to dependencies without consideration for versions in core libraries. 'rocket_dyn_templates' replaces the contrib 'templates' features. While largely a 1-to-1 copy, it makes the following changes: * the 'tera_templates' feature is now 'tera' * the 'handlebars_templates' feature is now 'handlebars' * fails to compile if neither 'tera' nor 'handlebars' is enabled 'rocket_sync_db_pools' replaces the contrib 'database' features. It makes no changes to the replaced features except that the `database` attribute is properly documented at the crate root.
34 lines
567 B
Rust
34 lines
567 B
Rust
use rocket_sync_db_pools::database;
|
|
|
|
#[allow(unused_imports)]
|
|
use rocket_sync_db_pools::diesel;
|
|
|
|
#[database]
|
|
struct A(diesel::SqliteConnection);
|
|
|
|
#[database(1)]
|
|
struct B(diesel::SqliteConnection);
|
|
|
|
#[database(123)]
|
|
struct C(diesel::SqliteConnection);
|
|
|
|
#[database("hello" "hi")]
|
|
struct D(diesel::SqliteConnection);
|
|
|
|
#[database("test")]
|
|
enum Foo { }
|
|
|
|
#[database("test")]
|
|
struct Bar(diesel::SqliteConnection, diesel::SqliteConnection);
|
|
|
|
#[database("test")]
|
|
union Baz { }
|
|
|
|
#[database("test")]
|
|
struct E<'r>(&'r str);
|
|
|
|
#[database("test")]
|
|
struct F<T>(T);
|
|
|
|
fn main() { }
|