mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-15 01:39:25 +00:00
28 lines
599 B
Rust
28 lines
599 B
Rust
|
pub trait Db: salsa::DbWithJar<Jar> {}
|
||
|
|
||
|
#[salsa::jar(db = Db)]
|
||
|
pub struct Jar(SourceTree, SourceTree_all_items, use_tree);
|
||
|
|
||
|
#[derive(Debug, PartialEq, Eq, Hash)]
|
||
|
pub struct Item {}
|
||
|
|
||
|
#[salsa::tracked(jar = Jar)]
|
||
|
pub struct SourceTree {}
|
||
|
|
||
|
#[salsa::tracked(jar = Jar)]
|
||
|
impl SourceTree {
|
||
|
#[salsa::tracked(return_ref)]
|
||
|
pub fn all_items(self, _db: &dyn Db) -> Vec<Item> {
|
||
|
todo!()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#[salsa::tracked(jar = Jar, return_ref)]
|
||
|
fn use_tree(_db: &dyn Db, _tree: SourceTree) {}
|
||
|
|
||
|
#[allow(unused)]
|
||
|
fn use_it(db: &dyn Db, tree: SourceTree) {
|
||
|
tree.all_items(db);
|
||
|
use_tree(db, tree);
|
||
|
}
|