mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-24 22:03:34 +00:00
update docs
This commit is contained in:
parent
a8d9fb2d6b
commit
f4c3aae081
1 changed files with 8 additions and 2 deletions
|
@ -54,8 +54,14 @@ fn length(db: &impl HelloWorldDatabase, (): ()) -> usize {
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// Step 3. Define the database struct
|
||||
|
||||
// Define the actual database struct. This must contain a salsa
|
||||
// runtime but can also contain anything else you need.
|
||||
// Define the actual database struct. This struct needs to be
|
||||
// annotated with `#[salsa::database(..)]`, which contains a list of
|
||||
// query groups that this database supports. This attribute macro will generate
|
||||
// the necessary impls so that the database implements all of those traits.
|
||||
//
|
||||
// The database struct can contain basically anything you need, but it
|
||||
// must have a `runtime` field as shown, and you must implement the
|
||||
// `salsa::Database` trait (as shown below).
|
||||
#[salsa::database(HelloWorldDatabase)]
|
||||
#[derive(Default)]
|
||||
struct DatabaseStruct {
|
||||
|
|
Loading…
Reference in a new issue