mirror of
https://github.com/salsa-rs/salsa.git
synced 2024-11-24 20:20:26 +00:00
25 lines
522 B
Rust
25 lines
522 B
Rust
#[salsa::db]
|
|
pub trait Db: salsa::Database {}
|
|
|
|
#[derive(Debug, PartialEq, Eq, Hash)]
|
|
pub struct Item {}
|
|
|
|
#[salsa::tracked]
|
|
pub struct SourceTree<'db> {}
|
|
|
|
#[salsa::tracked]
|
|
impl<'db> SourceTree<'db> {
|
|
#[salsa::tracked(return_ref)]
|
|
pub fn all_items(self, _db: &'db dyn Db) -> Vec<Item> {
|
|
todo!()
|
|
}
|
|
}
|
|
|
|
#[salsa::tracked(return_ref)]
|
|
fn use_tree<'db>(_db: &'db dyn Db, _tree: SourceTree<'db>) {}
|
|
|
|
#[allow(unused)]
|
|
fn use_it(db: &dyn Db, tree: SourceTree) {
|
|
tree.all_items(db);
|
|
use_tree(db, tree);
|
|
}
|