-
-
Notifications
You must be signed in to change notification settings - Fork 1
Update Cookbook docs: rename rustapi to rustapi-rs and add jobs learning path #86
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
Changes from all commits
7b890b9
db99e86
2694058
5c26ec0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ Handling file uploads efficiently is crucial. RustAPI allows you to stream `Mult | |
|
|
||
| ```toml | ||
| [dependencies] | ||
| rustapi = { version = "0.1.275", features = ["multipart"] } | ||
| rustapi-rs = "0.1.275" | ||
| tokio = { version = "1", features = ["fs", "io-util"] } | ||
| uuid = { version = "1", features = ["v4"] } | ||
| ``` | ||
|
|
@@ -16,8 +16,8 @@ uuid = { version = "1", features = ["v4"] } | |
| This handler reads the incoming stream part-by-part and writes it directly to disk (or S3). | ||
|
|
||
| ```rust | ||
| use rustapi::prelude::*; | ||
| use rustapi::extract::Multipart; | ||
| use rustapi_rs::prelude::*; | ||
| use rustapi_rs::extract::Multipart; | ||
| use tokio::fs::File; | ||
|
Comment on lines
+19
to
21
|
||
| use tokio::io::AsyncWriteExt; | ||
|
|
||
|
|
@@ -58,7 +58,7 @@ async fn upload_file(mut multipart: Multipart) -> Result<StatusCode, ApiError> { | |
| You should always set limits to prevent DoS attacks. | ||
|
|
||
| ```rust | ||
| use rustapi::extract::DefaultBodyLimit; | ||
| use rustapi_rs::extract::DefaultBodyLimit; | ||
|
|
||
| let app = RustApi::new() | ||
| .route("/upload", post(upload_file)) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ WebSocket connections start as HTTP requests. We "upgrade" them. | |
|
|
||
| ```rust | ||
| use rustapi_ws::{WebSocket, WebSocketUpgrade, Message}; | ||
| use rustapi::prelude::*; | ||
| use rustapi_rs::prelude::*; | ||
| use std::sync::Arc; | ||
|
Comment on lines
19
to
21
|
||
| use tokio::sync::broadcast; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependencies list in this recipe does not include
rustapi-rs, but the code sample importsrustapi_rs::prelude::*and usesRustApi/routing helpers. Addrustapi-rs = "0.1.275"(and any needed feature flags) to the Dependencies section so the example is copy/pasteable and compiles.