From 98a90808b40413712db1d71907dfc921d6f38aa7 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Mon, 3 Feb 2020 00:53:59 -0800 Subject: [PATCH] Fix an array of broken doc links. --- contrib/lib/src/databases.rs | 1 + contrib/lib/src/json.rs | 2 +- contrib/lib/src/lib.rs | 3 +-- contrib/lib/src/serve.rs | 2 +- contrib/lib/src/templates/mod.rs | 4 ++++ core/lib/src/config/mod.rs | 2 ++ core/lib/src/local/mod.rs | 3 +++ core/lib/src/outcome.rs | 20 +++++++++++--------- core/lib/src/shutdown.rs | 5 ++++- 9 files changed, 28 insertions(+), 14 deletions(-) diff --git a/contrib/lib/src/databases.rs b/contrib/lib/src/databases.rs index 4f12b130..9aa27e22 100644 --- a/contrib/lib/src/databases.rs +++ b/contrib/lib/src/databases.rs @@ -394,6 +394,7 @@ //! //! [`FromRequest`]: rocket::request::FromRequest //! [request guards]: rocket::request::FromRequest +//! [`Poolable`]: crate::databases::Poolable pub extern crate r2d2; diff --git a/contrib/lib/src/json.rs b/contrib/lib/src/json.rs index fa71547e..6d2c5f07 100644 --- a/contrib/lib/src/json.rs +++ b/contrib/lib/src/json.rs @@ -1,6 +1,6 @@ //! Automatic JSON (de)serialization support. //! -//! See the [`Json`] type for further details. +//! See the [`Json`](crate::json::Json) type for further details. //! //! # Enabling //! diff --git a/contrib/lib/src/lib.rs b/contrib/lib/src/lib.rs index 58a02112..72271f1c 100644 --- a/contrib/lib/src/lib.rs +++ b/contrib/lib/src/lib.rs @@ -24,7 +24,6 @@ //! * [uuid](uuid) - UUID (de)serialization //! * [${database}_pool](databases) - Database Configuration and Pooling //! * [helmet](helmet) - Fairing for Security and Privacy Headers -//! * [compression](compression) - Response compression //! //! The recommend way to include features from this crate via Cargo in your //! project is by adding a `[dependencies.rocket_contrib]` section to your @@ -51,7 +50,7 @@ #[cfg(feature="uuid")] pub mod uuid; #[cfg(feature="databases")] pub mod databases; #[cfg(feature = "helmet")] pub mod helmet; -// TODO.async: Migrate compression, reenable this and tests +// TODO.async: Migrate compression, reenable this, tests, and add to docs. //#[cfg(any(feature="brotli_compression", feature="gzip_compression"))] pub mod compression; #[cfg(feature="databases")] #[doc(hidden)] pub use rocket_contrib_codegen::*; diff --git a/contrib/lib/src/serve.rs b/contrib/lib/src/serve.rs index 39511b4f..5a41e2f9 100644 --- a/contrib/lib/src/serve.rs +++ b/contrib/lib/src/serve.rs @@ -1,6 +1,6 @@ //! Custom handler and options for static file serving. //! -//! See the [`StaticFiles`] type for further details. +//! See the [`StaticFiles`](crate::serve::StaticFiles) type for further details. //! //! # Enabling //! diff --git a/contrib/lib/src/templates/mod.rs b/contrib/lib/src/templates/mod.rs index b6b00ad4..0ba5e51d 100644 --- a/contrib/lib/src/templates/mod.rs +++ b/contrib/lib/src/templates/mod.rs @@ -111,6 +111,10 @@ //! template reloading is disabled to improve performance and cannot be enabled. //! //! [`Serialize`]: serde::Serialize +//! [`Template`]: crate::templates::Template +//! [`Template::fairing()`]: crate::templates::Template::fairing() +//! [`Template::custom()`]: crate::templates::Template::custom() +//! [`Template::render()`]: crate::templates::Template::render() #[cfg(feature = "tera_templates")] pub extern crate tera; #[cfg(feature = "tera_templates")] mod tera_templates; diff --git a/core/lib/src/config/mod.rs b/core/lib/src/config/mod.rs index 8e0aa880..4dc1ac4e 100644 --- a/core/lib/src/config/mod.rs +++ b/core/lib/src/config/mod.rs @@ -157,6 +157,8 @@ //! can be retrieved via the [`Rocket::config()`](crate::Rocket::config()) method //! on `Rocket` and `get_` methods on [`Config`] structure. //! +//! [`Rocket::config()`]: crate::Rocket::config() +//! //! The retrivial of configuration parameters usually occurs at launch time via //! a [launch fairing](crate::fairing::Fairing). If information about the //! configuraiton is needed later in the program, an attach fairing can be used diff --git a/core/lib/src/local/mod.rs b/core/lib/src/local/mod.rs index 53ba9cf7..a238f11e 100644 --- a/core/lib/src/local/mod.rs +++ b/core/lib/src/local/mod.rs @@ -98,6 +98,9 @@ //! } //! } //! ``` +//! +//! [`Client`]: crate::local::Client +//! [`LocalRequest`]: crate::local::LocalRequest mod request; mod client; diff --git a/core/lib/src/outcome.rs b/core/lib/src/outcome.rs index c4de4599..d56cd0eb 100644 --- a/core/lib/src/outcome.rs +++ b/core/lib/src/outcome.rs @@ -9,25 +9,27 @@ //! processing next. //! //! The `Outcome` type is the return type of many of the core Rocket traits, -//! including [`FromRequest`](crate::request::FromRequest), -//! [`FromData`](crate::data::FromData), and -//! [`Responder`](crate::response::Responder). It is also the return type of -//! request handlers via the [`Response`](crate::response::Response) type. +//! including [`FromRequest`](crate::request::FromRequest), [`FromData`] +//! [`Responder`]. It is also the return type of request handlers via the +//! [`Response`](crate::response::Response) type. +//! +//! [`FromData`]: crate::data::FromData +//! [`Responder`]: crate::response::Responder //! //! # Success //! //! A successful `Outcome`, `Success(S)`, is returned from functions //! that complete successfully. The meaning of a `Success` outcome depends on //! the context. For instance, the `Outcome` of the `from_data` method of the -//! `FromData` trait will be matched against the type expected by the user. For -//! example, consider the following handler: +//! [`FromData`] trait will be matched against the type expected by the user. +//! For example, consider the following handler: //! //! ```rust,ignore //! #[post("/", data = "")] //! fn hello(my_val: S) -> ... { } //! ``` //! -//! The `FromData` implementation for the type `S` returns an `Outcome` with a +//! The [`FromData`] implementation for the type `S` returns an `Outcome` with a //! `Success(S)`. If `from_data` returns a `Success`, the `Success` value will //! be unwrapped and the value will be used as the value of `my_val`. //! @@ -48,7 +50,7 @@ //! fn hello(my_val: Result) -> ... { } //! ``` //! -//! The `FromData` implementation for the type `S` returns an `Outcome` with a +//! The [`FromData`] implementation for the type `S` returns an `Outcome` with a //! `Success(S)` and `Failure(E)`. If `from_data` returns a `Failure`, the //! `Failure` value will be unwrapped and the value will be used as the `Err` //! value of `my_val` while a `Success` will be unwrapped and used the `Ok` @@ -69,7 +71,7 @@ //! fn hello(my_val: S) -> ... { } //! ``` //! -//! The `FromData` implementation for the type `S` returns an `Outcome` with a +//! The [`FromData`] implementation for the type `S` returns an `Outcome` with a //! `Success(S)`, `Failure(E)`, and `Forward(F)`. If the `Outcome` is a //! `Forward`, the `hello` handler isn't called. Instead, the incoming request //! is forwarded, or passed on to, the next matching route, if any. Ultimately, diff --git a/core/lib/src/shutdown.rs b/core/lib/src/shutdown.rs index 463e3732..40f7c6d8 100644 --- a/core/lib/src/shutdown.rs +++ b/core/lib/src/shutdown.rs @@ -5,7 +5,10 @@ use tokio::sync::mpsc; /// shut down. Once a server shutdown has been requested manually by calling /// [`ShutdownHandle::shutdown()`] or automatically by `Ctrl-C` being pressed /// (if enabled), Rocket will finish handling any pending requests and return to -/// the caller of [`Rocket::serve`] or [`Rocket::launch`]. +/// the caller of [`Rocket::serve()`] or [`Rocket::launch()`]. +/// +/// [`Rocket::serve()`]: crate::Rocket::serve() +/// [`Rocket::launch()`]: crate::Rocket::launch() /// /// # Example ///