Skip to content

Commit b212baf

Browse files
committed
Fix doc warnings
1 parent a73a689 commit b212baf

File tree

54 files changed

+121
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+121
-153
lines changed

crates/bench/src/bin/summarize.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Script to pack benchmark results into JSON files.
2-
//! These are read by the benchmarks-viewer application: https://github.com/clockworklabs/benchmarks-viewer,
2+
//! These are read by the benchmarks-viewer application: <https://github.com/clockworklabs/benchmarks-viewer>,
33
//! which is used to generate reports on the benchmarks.
44
//! See also: the github actions scripts that invoke this command, `SpacetimeDB/.github/workflows/benchmarks.yml` and `SpacetimeDB/.github/workflows/callgrind_benchmarks.yml`.
55
use clap::{Parser, Subcommand};
@@ -110,7 +110,7 @@ mod criterion {
110110
///
111111
/// Unfortunately, there is no published library for this, so we use the schema
112112
/// from `critcmp` under the MIT license:
113-
/// https://github.com/BurntSushi/critcmp/blob/daaf0383c3981c98a6eaaef47142755e5bddb3c4/src/data.rs
113+
/// <https://github.com/BurntSushi/critcmp/blob/daaf0383c3981c98a6eaaef47142755e5bddb3c4/src/data.rs>
114114
///
115115
/// TODO(jgilles): update this if we update our Criterion version past 0.4.
116116
#[allow(unused)]

crates/bindings-macro/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ pub fn reducer(args: StdTokenStream, item: StdTokenStream) -> StdTokenStream {
112112
}
113113

114114
/// It turns out to be shockingly difficult to construct an [`Attribute`].
115-
/// That type is not [`Parse`], instead having two distinct methods
115+
/// That type is not [`syn::parse::Parse`], instead having two distinct methods
116116
/// for parsing "inner" vs "outer" attributes.
117117
///
118-
/// We need this [`Attribute`] in [`table`] so that we can "pushnew" it
119-
/// onto the end of a list of attributes. See comments within [`table`].
118+
/// We need this [`Attribute`] in [`crate::table()`] so that we can "pushnew" it
119+
/// onto the end of a list of attributes. See comments within [`crate::table()`].
120120
fn derive_table_helper_attr() -> Attribute {
121121
let source = quote!(#[derive(spacetimedb::__TableHelper)]);
122122

crates/cli/src/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ pub struct ServerConfig {
2828
}
2929

3030
impl ServerConfig {
31-
/// Generate a new [`Table`] representing this [`ServerConfig`].
31+
/// Generate a new [`toml_edit::Table`] representing this [`ServerConfig`].
3232
pub fn as_table(&self) -> toml_edit::Table {
3333
let mut table = toml_edit::Table::new();
3434
Self::update_table(&mut table, self);
3535
table
3636
}
3737

38-
/// Update an existing [`Table`] with the values of a [`ServerConfig`].
38+
/// Update an existing [`toml_edit::Table`] with the values of a [`ServerConfig`].
3939
pub fn update_table(edit: &mut toml_edit::Table, from: &ServerConfig) {
4040
set_table_opt_value(edit, NICKNAME_KEY, from.nickname.as_deref());
4141
set_table_opt_value(edit, HOST_KEY, Some(&from.host));

crates/cli/src/subcommands/subscribe.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ where
198198
ws.send(msg.into()).await
199199
}
200200

201-
/// Await the initial [`ServerMessage::SubscriptionUpdate`].
201+
/// Await the initial [`ws::ServerMessage::TransactionUpdateLight`] `|` [`ws::ServerMessage::TransactionUpdate`].
202202
/// If `module_def` is `Some`, print a JSON representation to stdout.
203203
async fn await_initial_update<S>(ws: &mut S, module_def: Option<&RawModuleDefV9>) -> anyhow::Result<()>
204204
where
@@ -232,7 +232,7 @@ where
232232
Ok(())
233233
}
234234

235-
/// Print `num` [`ServerMessage::TransactionUpdate`] messages as JSON.
235+
/// Print `num` [`ws::ServerMessage::TransactionUpdateLight`] `|` [`ws::ServerMessage::TransactionUpdate`] messages as JSON.
236236
/// If `num` is `None`, keep going indefinitely.
237237
async fn consume_transaction_updates<S>(
238238
ws: &mut S,

crates/client-api/src/auth.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl SpacetimeCreds {
6565

6666
/// The auth information in a request.
6767
///
68-
/// This is inserted as an extension by [`auth_middleware`]; make sure that's applied if you're making expecting
68+
/// This is inserted as an extension by [`anon_auth_middleware`]; make sure that's applied if you're making expecting
6969
/// this to be present.
7070
#[derive(Clone)]
7171
pub struct SpacetimeAuth {

crates/client-api/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl Host {
130130

131131
/// Parameters for publishing a database.
132132
///
133-
/// See [`ControlStateDelegate::publish_database`].
133+
/// See [`ControlStateWriteAccess::publish_database`].
134134
pub struct DatabaseDef {
135135
/// The [`Identity`] the database shall have.
136136
pub database_identity: Identity,

crates/core/src/callgrind_flag.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ use std::sync::atomic::{AtomicU32, Ordering};
1313
/// Our solution is to wrap the code of interest in a function that is only called when the global flag is set.
1414
///
1515
/// See: documentation on valgrind/callgrind/iai-callgrind's `toggle-collect` option (ctrl-f on these pages):
16-
/// - https://github.com/iai-callgrind/iai-callgrind/
17-
/// - https://valgrind.org/docs/manual/cl-manual.html
16+
/// - <https://github.com/iai-callgrind/iai-callgrind/>
17+
/// - <https://valgrind.org/docs/manual/cl-manual.html>
1818
///
19-
/// We do NOT use the valgrind macros (or the crate https://github.com/2dav/crabgrind) because they are a pain to build.
19+
/// We do NOT use the valgrind macros (or the crate <https://github.com/2dav/crabgrind>) because they are a pain to build.
2020
/// (Hours wasted here: 9.)
2121
/// Instead, we have a wrapper function which is only called when a global flag is set.
2222
///

crates/core/src/client/client_connection.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ pub struct ClientConfig {
4141
pub protocol: Protocol,
4242
/// The client's desired (conditional) compression algorithm, if any.
4343
pub compression: Compression,
44-
/// Whether the client prefers full [`TransactionUpdate`]s
45-
/// rather than [`TransactionUpdateLight`]s on a successful update.
44+
/// Whether the client prefers full [`spacetimedb_client_api_messages::websocket::TransactionUpdate`]s
45+
/// rather than [`spacetimedb_client_api_messages::websocket::TransactionUpdateLight`]s on a successful update.
4646
// TODO(centril): As more knobs are added, make this into a bitfield (when there's time).
4747
pub tx_update_full: bool,
4848
}

crates/core/src/db/datastore/locking_tx_datastore/committed_state.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ impl CommittedState {
432432
}
433433

434434
/// When there's an index on `cols`,
435-
/// returns an iterator over the [TableIndex] that yields all the [`RowRef`]s
435+
/// returns an iterator over the [spacetimedb_table::table_index::TableIndex] that yields all the [`RowRef`]s
436436
/// that match the specified `range` in the indexed column.
437437
///
438438
/// Matching is defined by `Ord for AlgebraicValue`.

crates/core/src/db/datastore/locking_tx_datastore/datastore.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl Locking {
166166
/// - Construct all the tables referenced by `snapshot`, computing their schemas
167167
/// either from known system table schemas or from `st_table` and friends.
168168
/// - Populate those tables with all rows in `snapshot`.
169-
/// - Construct a [`HashMapBlobStore`] containing all the large blobs referenced by `snapshot`,
169+
/// - Construct a [`spacetimedb_table::blob_store::HashMapBlobStore`] containing all the large blobs referenced by `snapshot`,
170170
/// with reference counts specified in `snapshot`.
171171
/// - Do [`CommittedState::reset_system_table_schemas`] to fix-up auto_inc IDs in the system tables,
172172
/// to ensure those schemas match what [`Self::bootstrap`] would install.

crates/core/src/db/datastore/locking_tx_datastore/delete_table.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use spacetimedb_table::{
33
indexes::{max_rows_in_page, PageIndex, PageOffset, RowPointer, Size, SquashedOffset},
44
};
55

6-
/// A table recording which rows of a table in the [`CommittedState`] that have been deleted.
6+
/// A table recording which rows of a table in the [`super::committed_state::CommittedState`] that have been deleted.
77
pub struct DeleteTable {
88
/// Keeps track of all the deleted row pointers.
99
deleted: Vec<Option<FixedBitSet>>,
@@ -27,7 +27,7 @@ impl DeleteTable {
2727
}
2828
}
2929

30-
/// Returns whether `ptr`, belonging to a table in [`CommittedState`], is recorded as deleted.
30+
/// Returns whether `ptr`, belonging to a table in [`super::committed_state::CommittedState`], is recorded as deleted.
3131
pub fn contains(&self, ptr: RowPointer) -> bool {
3232
let page_idx = ptr.page_index().idx();
3333
match self.deleted.get(page_idx) {
@@ -36,7 +36,7 @@ impl DeleteTable {
3636
}
3737
}
3838

39-
/// Marks `ptr`, belonging to a table in [`CommittedState`], as deleted.
39+
/// Marks `ptr`, belonging to a table in [`super::committed_state::CommittedState`], as deleted.
4040
///
4141
/// Returns `true` if `ptr` was not previously marked.
4242
pub fn insert(&mut self, ptr: RowPointer) -> bool {
@@ -84,7 +84,7 @@ impl DeleteTable {
8484
}
8585
}
8686

87-
/// Un-marks `ptr`, belonging to a table in [`CommittedState`], as deleted.
87+
/// Un-marks `ptr`, belonging to a table in [`super::committed_state::CommittedState`], as deleted.
8888
pub fn remove(&mut self, ptr: RowPointer) -> bool {
8989
let fixed_row_size = self.fixed_row_size;
9090
let page_idx = ptr.page_index().idx();

crates/core/src/db/datastore/system_tables.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! - You will probably need to add a new ID type in `spacetimedb_primitives`,
99
//! with trait implementations in `spacetimedb_sats::{typespace, de::impl, ser::impl}`.
1010
//! - Add it to [`system_tables`], and define a constant for its index there.
11-
//! - Use [`st_fields_enum`] to define its column enum.
11+
//! - Use `st_fields_enum` to define its column enum.
1212
//! - Register its schema in [`system_module_def`], making sure to call `validate_system_table` at the end of the function.
1313
1414
use crate::db::relational_db::RelationalDB;
@@ -216,7 +216,7 @@ st_fields_enum!(enum StIndexFields {
216216
});
217217
// WARNING: For a stable schema, don't change the field names and discriminants.
218218
st_fields_enum!(
219-
/// The fields that define the internal table [crate::db::relational_db::ST_SEQUENCES_NAME].
219+
/// The fields that define the internal table [ST_SEQUENCE_NAME].
220220
enum StSequenceFields {
221221
"sequence_id", SequenceId = 0,
222222
"sequence_name", SequenceName = 1,
@@ -859,13 +859,13 @@ impl From<Identity> for IdentityViaU256 {
859859
/// * `database_identity` is the [`Identity`] of the database.
860860
/// * `owner_identity` is the [`Identity`] of the owner of the database.
861861
/// * `program_kind` is the [`ModuleKind`] (currently always [`WASM_MODULE`]).
862-
/// * `program_hash` is the [`Hash`] of the raw bytes of the (compiled) module.
862+
/// * `program_hash` is the [`struct@Hash`] of the raw bytes of the (compiled) module.
863863
/// * `program_bytes` are the raw bytes of the (compiled) module.
864864
/// * `module_version` is the version of the module.
865865
///
866866
/// | identity | owner_identity | program_kind | program_bytes | program_hash | module_version |
867867
/// |------------------|----------------|---------------|---------------|---------------------|----------------|
868-
/// | <bytes> | <bytes> | 0 | <bytes> | <bytes> | <string> |
868+
/// | `<bytes>` | `<bytes>` | 0 | `<bytes>` | `<bytes>` | `<string>` |
869869
#[derive(Clone, Debug, Eq, PartialEq, SpacetimeType)]
870870
#[sats(crate = spacetimedb_lib)]
871871
pub struct StModuleRow {
@@ -898,9 +898,9 @@ pub fn read_identity_from_col(row: RowRef<'_>, col: impl StFields) -> Result<Ide
898898
Ok(Identity::from_u256(row.read_col(col.col_id())?))
899899
}
900900

901-
/// Read a [`Hash`] directly from the column `col` in `row`.
901+
/// Read a [`struct@Hash`] directly from the column `col` in `row`.
902902
///
903-
/// The [`Hash`] is assumed to be stored as a flat byte array.
903+
/// The [`struct@Hash`] is assumed to be stored as a flat byte array.
904904
pub fn read_hash_from_col(row: RowRef<'_>, col: impl StFields) -> Result<Hash, DBError> {
905905
Ok(Hash::from_u256(row.read_col(col.col_id())?))
906906
}

crates/core/src/db/datastore/traits.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use spacetimedb_table::table::RowRef;
4141
/// nuanced example of how postgres deals with consistency guarantees at lower
4242
/// isolation levels.
4343
///
44-
/// - https://stackoverflow.com/questions/55254236/do-i-need-higher-transaction-isolation-to-make-constraints-work-reliably-in-post
44+
/// - <https://stackoverflow.com/questions/55254236/do-i-need-higher-transaction-isolation-to-make-constraints-work-reliably-in-post>
4545
///
4646
/// Thus from an application perspective, isolation anomalies may cause the data
4747
/// to be inconsistent or incorrect but will **not** cause it to violate the
@@ -79,13 +79,13 @@ use spacetimedb_table::table::RowRef;
7979
/// However since then database researchers have identified and cataloged many
8080
/// more. See:
8181
///
82-
/// - https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-95-51.pdf
83-
/// - https://pmg.csail.mit.edu/papers/adya-phd.pdf
82+
/// - <https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-95-51.pdf>
83+
/// - <https://pmg.csail.mit.edu/papers/adya-phd.pdf>
8484
///
8585
/// See the following table of anomalies for a more complete list used as a
8686
/// reference for database implementers:
8787
///
88-
/// - https://github.com/ept/hermitage?tab=readme-ov-file#summary-of-test-results
88+
/// - <https://github.com/ept/hermitage?tab=readme-ov-file#summary-of-test-results>
8989
///
9090
/// The following anomalies are not part of the SQL standard, but are important:
9191
///
@@ -101,7 +101,7 @@ use spacetimedb_table::table::RowRef;
101101
/// PostgreSQL's documentation provides a good summary of the anomalies and
102102
/// isolation levels that it supports:
103103
///
104-
/// - https://www.postgresql.org/docs/current/transaction-iso.html
104+
/// - <https://www.postgresql.org/docs/current/transaction-iso.html>
105105
///
106106
/// IMPORTANT!!! The order of these isolation levels in the enum is significant
107107
/// because we often must check if one isolation level is higher (offers more

crates/core/src/db/relational_db.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ impl RelationalDB {
223223
///
224224
/// If, however, a non-empty `history` was supplied, [`Metadata`] will
225225
/// already be be set. In this case, i.e. if either [`Self::metadata`] or
226-
/// [`Self::program_bytes`] return a `Some` value, [`Self::set_initialized`]
226+
/// [`StModuleRow::program_bytes`] return a `Some` value, [`Self::set_initialized`]
227227
/// should _not_ be called.
228228
///
229229
/// Sometimes, one may want to obtain a database without a module (e.g. for
@@ -652,7 +652,7 @@ impl RelationalDB {
652652
/// If `(tx_data, ctx)` should be appended to the commitlog, do so.
653653
///
654654
/// Note that by this stage,
655-
/// [`crate::db::datastore::locking_tx_datastore::committed_state::tx_consumes_offset`]
655+
/// [`CommittedState::tx_consumes_offset`]
656656
/// has already decided based on the reducer and operations whether the transaction should be appended;
657657
/// this method is responsible only for reading its decision out of the `tx_data`
658658
/// and calling `durability.append_tx`.
@@ -1012,14 +1012,14 @@ impl RelationalDB {
10121012
self.inner.constraint_id_from_name(tx, constraint_name)
10131013
}
10141014

1015-
/// Adds the index into the [ST_INDEXES_NAME] table
1015+
/// Adds the index into the [super::datastore::system_tables::ST_INDEX_NAME] table
10161016
///
10171017
/// NOTE: It loads the data from the table into it before returning
10181018
pub fn create_index(&self, tx: &mut MutTx, schema: IndexSchema, is_unique: bool) -> Result<IndexId, DBError> {
10191019
self.inner.create_index_mut_tx(tx, schema, is_unique)
10201020
}
10211021

1022-
/// Removes the [`TableIndex`] from the database by their `index_id`
1022+
/// Removes the [`super::datastore::system_tables::StIndexRow`] from the database by their `index_id`
10231023
pub fn drop_index(&self, tx: &mut MutTx, index_id: IndexId) -> Result<(), DBError> {
10241024
self.inner.drop_index_mut_tx(tx, index_id)
10251025
}
@@ -1167,7 +1167,7 @@ impl RelationalDB {
11671167
self.inner.create_sequence_mut_tx(tx, sequence_schema)
11681168
}
11691169

1170-
///Removes the [Sequence] from database instance
1170+
///Removes the [`super::datastore::system_tables::StSequenceRow`] from database instance
11711171
pub fn drop_sequence(&self, tx: &mut MutTx, seq_id: SequenceId) -> Result<(), DBError> {
11721172
self.inner.drop_sequence_mut_tx(tx, seq_id)
11731173
}
@@ -1401,7 +1401,7 @@ pub mod tests_utils {
14011401
/// Create a [`TestDB`] which stores data in a local commitlog,
14021402
/// initialized with pre-existing data from `history`.
14031403
///
1404-
/// [`TestHistory::from_txes`] is an easy-ish way to construct a non-empty [`History`].
1404+
/// [`TestHistory::from_txes`] is an easy-ish way to construct a non-empty [`durability::History`].
14051405
///
14061406
/// `expected_num_clients` is the expected size of the `connected_clients` return
14071407
/// from [`RelationalDB::open`] after replaying `history`.

crates/core/src/host/host_controller.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ struct Host {
669669
replica_ctx: Arc<ReplicaContext>,
670670
/// Scheduler for repeating reducers, operating on the current `module`.
671671
scheduler: Scheduler,
672-
/// Handle to the metrics collection task started via [`disk_monitor`].
672+
/// Handle to the metrics collection task started via [`storage_monitor`].
673673
///
674674
/// The task collects metrics from the `replica_ctx`, and so stays alive as long
675675
/// as the `replica_ctx` is live. The task is aborted when [`Host`] is dropped.

crates/core/src/host/wasm_common/instrumentation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//! `noop` does nothing.
1515
//! `op` uses `std::time::Instant` and `std::time::Duration` to capture timings.
1616
//! Components which use the time-span interface will conditionally import one of the two modules, like:
17-
//! ```no-run
17+
//! ```no_run
1818
//! #[cfg(feature = "spacetimedb-wasm-instance-times)]
1919
//! use instrumentation::op as span;
2020
//! #[cfg(not(feature = "spacetimedb-wasm-instance-times)]

crates/core/src/host/wasmtime/wasm_instance_env.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ impl WasmInstanceEnv {
251251
/// host call, to provide consistent error handling and instrumentation.
252252
///
253253
/// This method should be used as opposed to a manual implementation,
254-
/// as it helps with upholding the safety invariants of [`bindings_sys::call`].
254+
/// as it helps with upholding the safety invariants of `spacetimedb_bindings_sys::call`.
255255
///
256256
/// Returns an error if writing `T` to `out` errors.
257257
fn cvt_ret<O: WasmPointee>(
@@ -379,7 +379,7 @@ impl WasmInstanceEnv {
379379
/// Starts iteration on each row, as BSATN-encoded, of a table identified by `table_id`.
380380
///
381381
/// On success, the iterator handle is written to the `out` pointer.
382-
/// This handle can be advanced by [`row_iter_bsatn_advance`].
382+
/// This handle can be advanced by [`Self::row_iter_bsatn_advance`].
383383
///
384384
/// # Traps
385385
///
@@ -436,7 +436,7 @@ impl WasmInstanceEnv {
436436
/// which is unique for the module.
437437
///
438438
/// On success, the iterator handle is written to the `out` pointer.
439-
/// This handle can be advanced by [`row_iter_bsatn_advance`].
439+
/// This handle can be advanced by [`Self::row_iter_bsatn_advance`].
440440
///
441441
/// # Non-obvious queries
442442
///
@@ -783,7 +783,7 @@ impl WasmInstanceEnv {
783783
/// in WASM memory.
784784
///
785785
/// This syscall will delete all the rows found by
786-
/// [`datastore_index_scan_range_bsatn`] with the same arguments passed,
786+
/// [`Self::datastore_index_scan_range_bsatn`] with the same arguments passed,
787787
/// including `prefix_elems`.
788788
/// See `datastore_index_scan_range_bsatn` for details.
789789
///
@@ -1089,7 +1089,7 @@ impl WasmInstanceEnv {
10891089
}
10901090

10911091
/// Logs at `level` a `message` message occuring in `filename:line_number`
1092-
/// with [`target`](target) being the module path at the `log!` invocation site.
1092+
/// with [`target`](https://docs.rs/log/latest/log/struct.Record.html#method.target) being the module path at the `log!` invocation site.
10931093
///
10941094
/// These various pointers are interpreted lossily as UTF-8 strings with a corresponding `_len`.
10951095
///
@@ -1107,8 +1107,6 @@ impl WasmInstanceEnv {
11071107
/// - `target` is not NULL and `target_ptr[..target_len]` is not in bounds of WASM memory.
11081108
/// - `filename` is not NULL and `filename_ptr[..filename_len]` is not in bounds of WASM memory.
11091109
/// - `message` is not NULL and `message_ptr[..message_len]` is not in bounds of WASM memory.
1110-
///
1111-
/// [target]: https://docs.rs/log/latest/log/struct.Record.html#method.target
11121110
#[tracing::instrument(level = "trace", skip_all)]
11131111
pub fn console_log(
11141112
caller: Caller<'_, Self>,
@@ -1154,7 +1152,7 @@ impl WasmInstanceEnv {
11541152

11551153
/// Begins a timing span with `name = name_ptr[..name_len]`.
11561154
///
1157-
/// When the returned `ConsoleTimerId` is passed to [`console_timer_end`],
1155+
/// When the returned `ConsoleTimerId` is passed to [`Self::console_timer_end`],
11581156
/// the duration between the calls will be printed to the module's logs.
11591157
///
11601158
/// The `name` is interpreted lossily as a UTF-8 string.

0 commit comments

Comments
 (0)