Expand description
Rustlavel — a Laravel-inspired web framework for Rust.
ⓘ
use rustlavel::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
App::new()?.routes(routes::web).serve().await
}Optional packages are enabled through feature flags; what is not enabled is never compiled.
Re-exports§
pub use tokio;
Modules§
- config
- Configuration:
config.get("app.name"). - cookie
- Cookie construction and parsing.
- env
- Our own
.envloader. - error_
page - The development error page.
- events
- The internal instrumentation bus.
- json
- A self-contained JSON implementation: value model, parser, and serializer.
- log
- Leveled logging that doubles as instrumentation.
- middleware
- The middleware pipeline.
- prelude
- Everything an application file usually needs.
- request
- response
- router
- The router: what an application’s
routes/web.rsfills in. - server
- The HTTP/1.1 server: accept loop, request parsing, keep-alive, and a graceful shutdown that lets in-flight requests finish.
- status
- test_
prelude - Helpers for writing application tests.
- testing
- The test client.
- url
- Percent-encoding and query-string handling.
Structs§
- App
- The entry point of every rustlavel application.
- Config
- The application’s configuration tree.
- Console
- Everything the application knows how to do besides serve.
- Context
- Shared state handed to every request, cheap to clone.
- Cookie
- A cookie to be sent with a response.
- Event
- One recorded moment: a request, a query, a dispatched job, an exception.
- Files
- Serves files from a directory, refusing anything that escapes it.
- Headers
- Named
Routes - The named routes of a finished router.
- Next
- The rest of the pipeline, handed to each middleware in turn.
- Request
- An incoming request, already parsed and matched against a route.
- Resource
- The seven RESTful routes, registered one at a time.
- Response
- An outgoing response.
- Router
- Collects routes, then answers requests.
- Setup
- What a plugin is handed when it registers.
- SseEvent
- One event.
- Status
- An HTTP status code, kept as a plain
u16so any code can be expressed. - Test
Client - Test
Response - A response with assertions attached, each returning
selfso they chain.
Enums§
Traits§
- Handler
- Anything that can answer a request.
- Middleware
- Plugin
Type Aliases§
- BoxFuture
- A boxed, owned future — the shape every handler and middleware returns.
- Result
- The framework-wide result type.