Skip to content

Fully update documentation for 0.5 #1329

@jebrosen

Description

@jebrosen

Rocket 0.5 is nearing completion, but several docs are lagging behind the actual code. This meta-issue tracks progress in getting documentation fully up-to-date.

  • Async I/O Guidance

    Async is a big change that goes beyond function names and signatures. Accordingly, it will need additional documentation especially in the guide and the CHANGELOG and migration guide. The following topics and more should be considered:

    • Blocking operations in route handlers / cooperative multitasking
      • Rough guidelines of "acceptable" blocking, e.g. low-contention, short-held mutexes, and "unacceptable" blocking, e.g. filesystem and network I/O.
      • Examples of asynchronous alternatives or wrappers for synchronous libraries
      • Workarounds for blocking APIs along with suggested usage and examples: spawn_blocking, block_in_place, dedicated worker tasks and channels, etc.
    • Ergonomics of lifetimes, borrowing, async move, and non-Send data
    • Commonly experienced papercuts or limitations in the compiler.
      • Values unnecessarily or surprisingly held across await points (often problematic for borrows and for Send) - e.g. Tracking issue for more precise coroutine captures rust-lang/rust#69663
      • (and more)
      • NB: Many of these issues will be solved "magically" (from the user perspective) by upgrading rustc after they have been fixed, so we should consider whether they are important/common enough to also be in Rocket's documentation
    • TODO: More ideas? Make suggestions!

    Based on questions seen in IRC and my own experiences while working with async, I have marked these details as especially problematic for migrations. These errors are relatively common, and also difficult to diagnose or understand without experience.

    Some of this documentation is not specific to Rocket, and can be supplemented by links to other resources such as:

    • The https://rust-lang.github.io/async-book/. Note that as of 2020-06-06, several chapters are still TODO.
    • Specific parts of the API documentation for supporting or utility crates such as futures and tokio.
  • Entry Attributes

    #[rocket::main], #[rocket::launch], and #[rocket::async_test] need detailed docs.

  • Forms Revamp

    The way forms work has been entirely revamped. The following items require updated or checked documentation.

    • FromForm and FromFormField derive codegen specs.
    • FromForm and FromFormField trait method docs.
  • Routing Changes

    The effect of changing <path..> is signifcant and should be called out especially.

    UTF-8 is now supported everywhere. One example mentions this, but we should likely call this out.

  • Broken Links (help!)

    Are all doc links valid and pointing somewhere? We need to run a link-checker on both the guide and rustdocs as well as handle all warnings issues by rustdoc.

CC #1242 (comment)
CC #1065

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentationhelp wantedContributions to this issue are needed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions