mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-08-04 19:08:32 +00:00
introduce Database::salsa_runtime_mut
method (breaking change!)
This commit is contained in:
parent
c789219bc5
commit
b9f00726da
19 changed files with 100 additions and 17 deletions
|
@ -27,9 +27,13 @@ pub struct DatabaseImpl {
|
|||
|
||||
/// This impl tells salsa where to find the salsa runtime.
|
||||
impl salsa::Database for DatabaseImpl {
|
||||
fn salsa_runtime(&self) -> &salsa::Runtime<DatabaseImpl> {
|
||||
fn salsa_runtime(&self) -> &salsa::Runtime<Self> {
|
||||
&self.runtime
|
||||
}
|
||||
|
||||
fn salsa_runtime_mut(&mut self) -> &mut salsa::Runtime<Self> {
|
||||
&mut self.runtime
|
||||
}
|
||||
}
|
||||
|
||||
/// In addition to the "query provider" traits, you may have other
|
||||
|
|
|
@ -79,9 +79,13 @@ struct DatabaseStruct {
|
|||
|
||||
// Tell salsa where to find the runtime in your context.
|
||||
impl salsa::Database for DatabaseStruct {
|
||||
fn salsa_runtime(&self) -> &salsa::Runtime<DatabaseStruct> {
|
||||
fn salsa_runtime(&self) -> &salsa::Runtime<Self> {
|
||||
&self.runtime
|
||||
}
|
||||
|
||||
fn salsa_runtime_mut(&mut self) -> &mut salsa::Runtime<Self> {
|
||||
&mut self.runtime
|
||||
}
|
||||
}
|
||||
|
||||
// This shows how to use a query.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue