mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-08-04 19:08:32 +00:00
implement the Storage<DB> change
This commit is contained in:
parent
4bf46f5f24
commit
67687376ed
22 changed files with 152 additions and 254 deletions
|
@ -187,19 +187,11 @@ fn snapshot_me(db: &impl ParDatabase) {
|
|||
#[salsa::database(Par)]
|
||||
#[derive(Default)]
|
||||
pub(crate) struct ParDatabaseImpl {
|
||||
runtime: salsa::Runtime<ParDatabaseImpl>,
|
||||
storage: salsa::Storage<Self>,
|
||||
knobs: KnobsStruct,
|
||||
}
|
||||
|
||||
impl Database for ParDatabaseImpl {
|
||||
fn salsa_runtime(&self) -> &salsa::Runtime<Self> {
|
||||
&self.runtime
|
||||
}
|
||||
|
||||
fn salsa_runtime_mut(&mut self) -> &mut salsa::Runtime<Self> {
|
||||
&mut self.runtime
|
||||
}
|
||||
|
||||
fn salsa_event(&self, event_fn: impl Fn() -> salsa::Event) {
|
||||
let event = event_fn();
|
||||
match event.kind {
|
||||
|
@ -219,7 +211,7 @@ impl Database for ParDatabaseImpl {
|
|||
impl ParallelDatabase for ParDatabaseImpl {
|
||||
fn snapshot(&self) -> Snapshot<Self> {
|
||||
Snapshot::new(ParDatabaseImpl {
|
||||
runtime: self.runtime.snapshot(self),
|
||||
storage: self.storage.snapshot(),
|
||||
knobs: self.knobs.clone(),
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue