-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fully update documentation for 0.5 #1329
Comments
I'd like to help write some of this documentation! Should I just open a PR with suggested changes? |
PRs including documentation are always welcome! (and sorry for the |
Is this the primary blocking issue for releasing v0.5? Would like to help how I can. Also, I found this article interesting: https://matej.laitl.cz/bench-actix-rocket/ Particularly the potential memory-leak in v0.5. Is this a known and/or resolved issue? If not, I can create an issue for it and help chase it down. |
This was a memory leak in dashmap which was temporarily a dependency of |
Great work, I am just learning Rocket and I noticed a broken link in the docs. I'm going to go try and fix it and open a PR. The broken link is here where it says "JSON example". I'm going to change it to point to https://github.com/SergioBenitez/Rocket/blob/v0.5-rc/examples/serialization/src/json.rs. |
Tokio's tutorial https://tokio.rs/tokio/tutorial would be great to link to directly in the guide. It's an excellent introduction to async rust in general, and it helps that tokio is re-exported by rocket. I continually see beginners confused by the async book, but after introducing tokio's tutorial, the concepts start to click for them. |
The async book was indeed pretty confusing when I first decided to learn |
0.5-rc1 documentation problems which were major barriers for new user (me):
|
@jblachly if you import |
@teymour-aldridge Thanks for your comment; I actually did not import models.rs use rocket::serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize)]
#[serde(crate = "rocket::serde")] // compilation fails without this
pub struct User<'r> {
// id: int
// email: str
// name: str
id: i32,
email: &'r str,
name: &'r str
} Now, probably I should be doing something else that an experienced rustacean would know to do, but I still assert that this is a documentation error, as following the 0.5-rc1 guide strictly yields this error by the time you reach https://rocket.rs/v0.5-rc/guide/requests/#json I only found the |
Sorry – you are right. I think it works for structs without lifetimes, but otherwise not (not sure, but in a few projects I have it definitely works without the crate attribute). |
@teymour-aldridge Apologies for cluttering this issue with marginally related discussion, but as a Rust newbie I am not sure the origin of this limitation; could you or others suggest where I might begin to understand why this directive is required with structs polymorphic over lifetime but not monomorphic structs? I would be happy to try to improve the documentation via PR once I understand the root cause of the issue. Alternatively, if someone else reads this and knows the answer please do update the 0.5-rc docs =) |
The migration guide (available in master, soon in rc.2), now includes async I/O guidance. This resolves the issue. For release specific documentation improvements unrelated to async I/O, [please discuss in the related release discussion. |
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:spawn_blocking
,block_in_place
, dedicated worker tasks and channels, etc.async move
, and non-Send
dataawait
points (often problematic for borrows and forSend
) - e.g. Tracking issue for more precise coroutine captures rust-lang/rust#69663rustc
after they have been fixed, so we should consider whether they are important/common enough to also be in Rocket's documentation† 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:
futures
andtokio
.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
andFromFormField
derive codegen specs.FromForm
andFromFormField
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
The text was updated successfully, but these errors were encountered: