Skip to content

Commit 94c5b55

Browse files
authored
Merge pull request #2914 from lann/doc-lints
Fix rustdoc lints and formatting
2 parents 05880e5 + fcbd288 commit 94c5b55

File tree

11 files changed

+66
-48
lines changed

11 files changed

+66
-48
lines changed

crates/doctor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub trait Diagnostic: Send + Sync {
128128
/// A [`Diagnosis`] representing the problem(s) this can detect.
129129
type Diagnosis: Diagnosis;
130130

131-
/// Check the given [`Patient`], returning any problem(s) found.
131+
/// Check the given [`PatientApp`], returning any problem(s) found.
132132
///
133133
/// If multiple _independently addressable_ problems are found, this may
134134
/// return multiple instances. If two "logically separate" problems would

crates/doctor/src/wasm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl PatientWasm {
5858
}
5959
}
6060

61-
/// WasmDiagnose helps implement [`Diagnose`] for Wasm source problems.
61+
/// WasmDiagnostic helps implement [`Diagnostic`] for Wasm source problems.
6262
#[async_trait]
6363
pub trait WasmDiagnostic {
6464
/// A [`Diagnosis`] representing the problem(s) this can detect.

crates/factor-key-value/src/runtime_config/spin.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ fn store_from_toml_fn<T: MakeKeyValueStore>(provider_type: T) -> StoreFromToml {
4040

4141
/// Converts from toml based runtime configuration into a [`RuntimeConfig`].
4242
///
43-
/// Also acts as [`DefaultLabelResolver`].
44-
///
45-
/// The various store types (i.e., the "type" field in the toml field) are registered with the
46-
/// resolver using `add_store_type`. The default store for a label is registered using `add_default_store`.
43+
/// The various store types (i.e., the "type" field in the toml field) are
44+
/// registered with the resolver using `add_store_type`. The default store for a
45+
/// label is registered using `add_default_store`.
4746
#[derive(Default, Clone)]
4847
pub struct RuntimeConfigResolver {
4948
/// A map of store types to a function that returns the appropriate store

crates/factor-key-value/src/util.rs

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,38 @@ impl StoreManager for DelegatingStoreManager {
4646
}
4747
}
4848

49-
/// Wrap each `Store` produced by the inner `StoreManager` in an asynchronous, write-behind cache.
49+
/// Wrap each `Store` produced by the inner `StoreManager` in an asynchronous,
50+
/// write-behind cache.
5051
///
5152
/// This serves two purposes:
5253
///
5354
/// - Improve performance with slow and/or distant stores
5455
///
55-
/// - Provide a relaxed consistency guarantee vs. what a fully synchronous store provides
56+
/// - Provide a relaxed consistency guarantee vs. what a fully synchronous store
57+
/// provides
5658
///
57-
/// The latter is intended to prevent guests from coming to rely on the synchronous consistency model of an
58-
/// existing implementation which may later be replaced with one providing a more relaxed, asynchronous
59-
/// (i.e. "eventual") consistency model. See also https://www.hyrumslaw.com/ and https://xkcd.com/1172/.
59+
/// The latter is intended to prevent guests from coming to rely on the
60+
/// synchronous consistency model of an existing implementation which may later
61+
/// be replaced with one providing a more relaxed, asynchronous (i.e.
62+
/// "eventual") consistency model. See also <https://www.hyrumslaw.com/> and
63+
/// <https://xkcd.com/1172/>.
6064
///
61-
/// This implementation provides a "read-your-writes", asynchronous consistency model such that values are
62-
/// immediately available for reading as soon as they are written as long as the read(s) hit the same cache as the
63-
/// write(s). Reads and writes through separate caches (e.g. separate guest instances or separately-opened
64-
/// references to the same store within a single instance) are _not_ guaranteed to be consistent; not only is
65-
/// cross-cache consistency subject to scheduling and/or networking delays, a given tuple is never refreshed from
66-
/// the backing store once added to a cache since this implementation is intended for use only by short-lived guest
67-
/// instances.
65+
/// This implementation provides a "read-your-writes", asynchronous consistency
66+
/// model such that values are immediately available for reading as soon as they
67+
/// are written as long as the read(s) hit the same cache as the write(s).
68+
/// Reads and writes through separate caches (e.g. separate guest instances or
69+
/// separately-opened references to the same store within a single instance) are
70+
/// _not_ guaranteed to be consistent; not only is cross-cache consistency
71+
/// subject to scheduling and/or networking delays, a given tuple is never
72+
/// refreshed from the backing store once added to a cache since this
73+
/// implementation is intended for use only by short-lived guest instances.
6874
///
69-
/// Note that, because writes are asynchronous and return immediately, durability is _not_ guaranteed. I/O errors
70-
/// may occur asynchronously after the write operation has returned control to the guest, which may result in the
71-
/// write being lost without the guest knowing. In the future, a separate `write-durable` function could be added
72-
/// to key-value.wit to provide either synchronous or asynchronous feedback on durability for guests which need it.
75+
/// Note that, because writes are asynchronous and return immediately,
76+
/// durability is _not_ guaranteed. I/O errors may occur asynchronously after
77+
/// the write operation has returned control to the guest, which may result in
78+
/// the write being lost without the guest knowing. In the future, a separate
79+
/// `write-durable` function could be added to key-value.wit to provide either
80+
/// synchronous or asynchronous feedback on durability for guests which need it.
7381
pub struct CachingStoreManager<T> {
7482
capacity: NonZeroUsize,
7583
inner: T,

crates/factor-outbound-http/src/intercept.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ use wasmtime_wasi_http::{body::HyperOutgoingBody, HttpResult};
66
pub type HyperBody = HyperOutgoingBody;
77

88
/// An outbound HTTP request interceptor to be used with
9-
/// [`InstanceState::set_request_interceptor`].
9+
/// [`super::InstanceState::set_request_interceptor`].
1010
#[async_trait]
1111
pub trait OutboundHttpInterceptor: Send + Sync {
1212
/// Intercept an outgoing HTTP request.
1313
///
14-
/// If this method returns [`InterceptedResponse::Continue`], the (possibly
14+
/// If this method returns [`InterceptOutcome::Continue`], the (possibly
1515
/// updated) request will be passed on to the default outgoing request
1616
/// handler.
1717
///
18-
/// If this method returns [`InterceptedResponse::Intercepted`], the inner
19-
/// result will be returned as the result of the request, bypassing the
20-
/// default handler. The `request` will also be dropped immediately.
18+
/// If this method returns [`InterceptOutcome::Complete`], the inner result
19+
/// will be returned as the result of the request, bypassing the default
20+
/// handler. The `request` will also be dropped immediately.
2121
async fn intercept(&self, request: InterceptRequest) -> HttpResult<InterceptOutcome>;
2222
}
2323

crates/factors-executor/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl<T: RuntimeFactors, U: Send + 'static> FactorsExecutor<T, U> {
4747
self.hooks.push(Box::new(hooks));
4848
}
4949

50-
/// Loads a [`FactorsApp`] with this executor.
50+
/// Loads a [`App`] with this executor.
5151
pub async fn load_app(
5252
self: Arc<Self>,
5353
app: App,
@@ -93,7 +93,7 @@ where
9393
Ok(())
9494
}
9595

96-
/// Prepare instance hooks run immediately before [`FactorsExecutor::prepare`] returns.
96+
/// Prepare instance hooks run immediately before [`FactorsExecutorApp::prepare`] returns.
9797
fn prepare_instance(&self, builder: &mut FactorsInstanceBuilder<T, U>) -> anyhow::Result<()> {
9898
let _ = builder;
9999
Ok(())

crates/factors/src/runtime_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl<F: Factor> FactorRuntimeConfigSource<F> for () {
1414
}
1515
}
1616

17-
/// Run some finalization logic on a [`RuntimeConfigSource`].
17+
/// Run some finalization logic on a [`FactorRuntimeConfigSource`].
1818
pub trait RuntimeConfigSourceFinalizer {
1919
/// Finalize the runtime config source.
2020
fn finalize(&mut self) -> anyhow::Result<()>;

crates/loader/src/cache.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,14 @@ impl Cache {
111111
}
112112

113113
/// Ensure the expected configuration directories are found in the root.
114+
///
115+
/// ```text
114116
/// └── <configuration-root>
115117
/// └── registry
116118
/// └──manifests
117119
/// └──wasm
118-
/// └─-data
120+
/// └──data
121+
/// ```
119122
pub async fn ensure_dirs(&self) -> Result<()> {
120123
tracing::debug!("using cache root directory {}", self.root.display());
121124

crates/locked-app/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ pub type Result<T> = std::result::Result<T, Error>;
2929
/// Errors returned by methods in this crate.
3030
#[derive(Debug, thiserror::Error)]
3131
pub enum Error {
32-
/// An error propagated from the [`spin_core`] crate.
32+
/// An error propagated from the `spin_core` crate.
3333
#[error(transparent)]
3434
CoreError(anyhow::Error),
35-
/// An error from a [`DynamicHostComponent`].
35+
/// An error from a `DynamicHostComponent`.
3636
#[error("host component error: {0:#}")]
3737
HostComponentError(#[source] anyhow::Error),
38-
/// An error from a [`Loader`] implementation.
38+
/// An error from a `Loader` implementation.
3939
#[error(transparent)]
4040
LoaderError(anyhow::Error),
4141
/// An error indicating missing or unexpected metadata.

crates/plugins/src/manifest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::PluginStore;
99

1010
/// Expected schema of a plugin manifest. Should match the latest Spin plugin
1111
/// manifest JSON schema:
12-
/// https://github.com/fermyon/spin-plugins/tree/main/json-schema
12+
/// <https://github.com/fermyon/spin-plugins/tree/main/json-schema>
1313
#[derive(Serialize, Debug, Deserialize, PartialEq)]
1414
#[serde(rename_all = "camelCase")]
1515
pub struct PluginManifest {

0 commit comments

Comments
 (0)