Skip to content

Commit 2b57c43

Browse files
authored
Merge pull request #86 from Tuntii/docs-update-cookbook-rustapi-rs-12846515349818711293
Update Cookbook docs: rename rustapi to rustapi-rs and add jobs learning path
2 parents 5ec3a9a + 5c26ec0 commit 2b57c43

5 files changed

Lines changed: 13 additions & 7 deletions

File tree

docs/cookbook/src/concepts/handlers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If the data cannot be extracted (e.g., missing header, invalid JSON), the reques
1515
A handler is simply an asynchronous function that takes zero or more **Extractors** as arguments and returns something that implements `IntoResponse`.
1616

1717
```rust
18-
use rustapi::prelude::*;
18+
use rustapi_rs::prelude::*;
1919

2020
async fn create_user(
2121
State(db): State<DbPool>, // 1. Dependency Injection

docs/cookbook/src/learning/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ If you prefer reading through documentation first, follow this path through the
1919
3. **Building Blocks**: Try the [Creating Resources](../recipes/crud_resource.md) recipe.
2020
4. **Security**: Implement [JWT Authentication](../recipes/jwt_auth.md) and [CSRF Protection](../recipes/csrf_protection.md).
2121
5. **Advanced**: Explore [Performance Tuning](../recipes/high_performance.md) and [HTTP/3](../recipes/http3_quic.md).
22+
6. **Background Jobs**: Master [rustapi-jobs](../crates/rustapi_jobs.md) for async processing.
2223

2324
### Why Use the Examples Repository?
2425

@@ -65,8 +66,11 @@ Design and build distributed systems with RustAPI.
6566
| 3 | `rate-limit-demo` | API protection, throttling |
6667
| 4 | `microservices` | Service communication patterns |
6768
| 5 | `microservices-advanced` | Service discovery, Consul integration |
69+
| 6 | Background jobs (conceptual) | Background processing with `rustapi-jobs`, Redis/Postgres backends |
6870

71+
> Note: The **Background jobs (conceptual)** step refers to using the `rustapi-jobs` crate rather than a standalone example project.
6972
**Related Cookbook Recipes:**
73+
- [rustapi-jobs](../crates/rustapi_jobs.md)
7074
- [Custom Middleware](../recipes/custom_middleware.md)
7175
- [Production Tuning](../recipes/high_performance.md)
7276
- [Deployment](../recipes/deployment.md)
@@ -116,9 +120,11 @@ Build robust, observable, and secure systems.
116120
| 2 | **Resilience** | Implement [Circuit Breakers and Retries](../crates/rustapi_extras.md#resilience) |
117121
| 3 | **Advanced Security** | Add [OAuth2 and Security Headers](../crates/rustapi_extras.md#advanced-security) |
118122
| 4 | **Optimization** | Configure [Caching and Deduplication](../crates/rustapi_extras.md#optimization) |
123+
| 5 | **Background Jobs** | Implement [Reliable Job Queues](../crates/rustapi_jobs.md) |
119124

120125
**Related Cookbook Recipes:**
121126
- [rustapi-extras: The Toolbox](../crates/rustapi_extras.md)
127+
- [rustapi-jobs: The Workhorse](../crates/rustapi_jobs.md)
122128

123129
---
124130

docs/cookbook/src/recipes/db_integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async fn main() {
5959
Extract the `State` to get access to the pool.
6060

6161
```rust
62-
use rustapi::prelude::*;
62+
use rustapi_rs::prelude::*;
6363

6464
#[derive(Deserialize)]
6565
struct CreateUser {

docs/cookbook/src/recipes/file_uploads.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Handling file uploads efficiently is crucial. RustAPI allows you to stream `Mult
66

77
```toml
88
[dependencies]
9-
rustapi = { version = "0.1.275", features = ["multipart"] }
9+
rustapi-rs = "0.1.275"
1010
tokio = { version = "1", features = ["fs", "io-util"] }
1111
uuid = { version = "1", features = ["v4"] }
1212
```
@@ -16,8 +16,8 @@ uuid = { version = "1", features = ["v4"] }
1616
This handler reads the incoming stream part-by-part and writes it directly to disk (or S3).
1717

1818
```rust
19-
use rustapi::prelude::*;
20-
use rustapi::extract::Multipart;
19+
use rustapi_rs::prelude::*;
20+
use rustapi_rs::extract::Multipart;
2121
use tokio::fs::File;
2222
use tokio::io::AsyncWriteExt;
2323

@@ -58,7 +58,7 @@ async fn upload_file(mut multipart: Multipart) -> Result<StatusCode, ApiError> {
5858
You should always set limits to prevent DoS attacks.
5959

6060
```rust
61-
use rustapi::extract::DefaultBodyLimit;
61+
use rustapi_rs::extract::DefaultBodyLimit;
6262

6363
let app = RustApi::new()
6464
.route("/upload", post(upload_file))

docs/cookbook/src/recipes/websockets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ WebSocket connections start as HTTP requests. We "upgrade" them.
1717

1818
```rust
1919
use rustapi_ws::{WebSocket, WebSocketUpgrade, Message};
20-
use rustapi::prelude::*;
20+
use rustapi_rs::prelude::*;
2121
use std::sync::Arc;
2222
use tokio::sync::broadcast;
2323

0 commit comments

Comments
 (0)