update docs

This commit is contained in:
Niko Matsakis 2019-01-25 04:50:13 -05:00
parent a8d9fb2d6b
commit f4c3aae081

View file

@ -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 {