Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cookbook/src/concepts/handlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If the data cannot be extracted (e.g., missing header, invalid JSON), the reques
A handler is simply an asynchronous function that takes zero or more **Extractors** as arguments and returns something that implements `IntoResponse`.

```rust
use rustapi::prelude::*;
use rustapi_rs::prelude::*;

async fn create_user(
State(db): State<DbPool>, // 1. Dependency Injection
Expand Down
6 changes: 6 additions & 0 deletions docs/cookbook/src/learning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ If you prefer reading through documentation first, follow this path through the
3. **Building Blocks**: Try the [Creating Resources](../recipes/crud_resource.md) recipe.
4. **Security**: Implement [JWT Authentication](../recipes/jwt_auth.md) and [CSRF Protection](../recipes/csrf_protection.md).
5. **Advanced**: Explore [Performance Tuning](../recipes/high_performance.md) and [HTTP/3](../recipes/http3_quic.md).
6. **Background Jobs**: Master [rustapi-jobs](../crates/rustapi_jobs.md) for async processing.

### Why Use the Examples Repository?

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

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

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

---

Expand Down
2 changes: 1 addition & 1 deletion docs/cookbook/src/recipes/db_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async fn main() {
Extract the `State` to get access to the pool.

```rust
use rustapi::prelude::*;
use rustapi_rs::prelude::*;

#[derive(Deserialize)]
Comment on lines 61 to 64
Copy link

Copilot AI Feb 4, 2026

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 imports rustapi_rs::prelude::* and uses RustApi/routing helpers. Add rustapi-rs = "0.1.275" (and any needed feature flags) to the Dependencies section so the example is copy/pasteable and compiles.

Copilot uses AI. Check for mistakes.
struct CreateUser {
Expand Down
8 changes: 4 additions & 4 deletions docs/cookbook/src/recipes/file_uploads.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
```
Expand All @@ -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
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rustapi_rs::extract::Multipart does not appear to exist in this codebase (there is no extract module exported by rustapi-rs). Multipart is already available from rustapi_rs::prelude::* (or via rustapi_rs::Multipart). Update the import to a valid path or drop it entirely to avoid a non-compiling example.

Copilot uses AI. Check for mistakes.
use tokio::io::AsyncWriteExt;

Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbook/src/recipes/websockets.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example now imports rustapi_rs::prelude::*, but the dependency snippet only includes rustapi-ws (and not rustapi-rs). As written, users won’t be able to compile RustApi::new(), routing helpers like get, or the rustapi_rs import. Consider switching to the supported pattern: depend on rustapi-rs with features = ["ws"] and import WebSocket types via rustapi_rs::ws::{...} (or ensure both crates are listed explicitly).

Copilot uses AI. Check for mistakes.
use tokio::sync::broadcast;

Expand Down
Loading