Correct mutability in on demand example, fix doc links

Fix query_mut documentation link

Fix more documentation links

More doc links
This commit is contained in:
Declan Kelly 2019-09-30 14:14:52 -07:00
parent e0def475d6
commit 564fa155d4
2 changed files with 7 additions and 7 deletions

View file

@ -22,7 +22,7 @@ trait VfsDatabase: salsa::Database + FileWatcher {
trait FileWatcher { trait FileWatcher {
fn watch(&self, path: &Path); fn watch(&self, path: &Path);
fn did_change_file(&self, path: &Path); fn did_change_file(&mut self, path: &Path);
} }
fn read(db: &impl salsa::Database, path: PathBuf) -> String { fn read(db: &impl salsa::Database, path: PathBuf) -> String {
@ -37,7 +37,7 @@ struct MyDatabase { ... }
impl FileWatcher for MyDatabase { impl FileWatcher for MyDatabase {
fn watch(&self, path: &Path) { ... } fn watch(&self, path: &Path) { ... }
fn did_change_file(&self, path: &Path) { fn did_change_file(&mut self, path: &Path) {
self.query_mut(ReadQuery).invalidate(path); self.query_mut(ReadQuery).invalidate(path);
} }
} }

View file

@ -377,7 +377,7 @@ pub trait ParallelDatabase: Database + Send {
/// only gives `&self` access to it. See [the `snapshot` method][fm] /// only gives `&self` access to it. See [the `snapshot` method][fm]
/// for more details. /// for more details.
/// ///
/// [fm]: trait.ParallelDatabase#method.snapshot /// [fm]: trait.ParallelDatabase.html#method.snapshot
#[derive(Debug)] #[derive(Debug)]
pub struct Snapshot<DB> pub struct Snapshot<DB>
where where
@ -451,7 +451,7 @@ pub unsafe trait Query<DB: Database>: Debug + Default + Sized + 'static {
/// Return value from [the `query` method] on `Database`. /// Return value from [the `query` method] on `Database`.
/// Gives access to various less common operations on queries. /// Gives access to various less common operations on queries.
/// ///
/// [the `query_mut` method]: trait.Database#method.query /// [the `query` method]: trait.Database.html#method.query
pub struct QueryTable<'me, DB, Q> pub struct QueryTable<'me, DB, Q>
where where
DB: plumbing::GetQueryTable<Q>, DB: plumbing::GetQueryTable<Q>,
@ -497,7 +497,7 @@ where
/// Gives access to the `set` method, notably, that is used to /// Gives access to the `set` method, notably, that is used to
/// set the value of an input query. /// set the value of an input query.
/// ///
/// [the `query_mut` method]: trait.Database#method.query_mut /// [the `query_mut` method]: trait.Database.html#method.query_mut
pub struct QueryTableMut<'me, DB, Q> pub struct QueryTableMut<'me, DB, Q>
where where
DB: plumbing::GetQueryTable<Q>, DB: plumbing::GetQueryTable<Q>,
@ -527,7 +527,7 @@ where
/// If you are using `snapshot`, see the notes on blocking /// If you are using `snapshot`, see the notes on blocking
/// and cancellation on [the `query_mut` method]. /// and cancellation on [the `query_mut` method].
/// ///
/// [the `query_mut` method]: trait.Database#method.query_mut /// [the `query_mut` method]: trait.Database.html#method.query_mut
pub fn set(&mut self, key: Q::Key, value: Q::Value) pub fn set(&mut self, key: Q::Key, value: Q::Value)
where where
Q::Storage: plumbing::InputQueryStorageOps<DB, Q>, Q::Storage: plumbing::InputQueryStorageOps<DB, Q>,
@ -542,7 +542,7 @@ where
/// If you are using `snapshot`, see the notes on blocking /// If you are using `snapshot`, see the notes on blocking
/// and cancellation on [the `query_mut` method]. /// and cancellation on [the `query_mut` method].
/// ///
/// [the `query_mut` method]: trait.Database#method.query_mut /// [the `query_mut` method]: trait.Database.html#method.query_mut
pub fn set_with_durability(&mut self, key: Q::Key, value: Q::Value, durability: Durability) pub fn set_with_durability(&mut self, key: Q::Key, value: Q::Value, durability: Durability)
where where
Q::Storage: plumbing::InputQueryStorageOps<DB, Q>, Q::Storage: plumbing::InputQueryStorageOps<DB, Q>,