Expand description
Stable core surface exposed by the facade.
Macros§
- route
- Helper macro to create a Route from a handler with RouteHandler trait
Structs§
- ApiError
- Standard API error type
- Async
Validated Json - Async validated JSON body extractor
- Body
- Raw body bytes extractor
- Body
Limit Layer - Body size limit middleware layer
- Body
Stream - Streaming body extractor
- Client
Ip - Client IP address extractor
- Created
- 201 Created response wrapper
- Extension
- Extension extractor
- Field
Error - Field-level validation error
- Handler
Service - Wrapper to convert a Handler into a tower Service
- Header
Value - Single header value extractor
- Headers
- Headers extractor
- Html
- HTML response wrapper
- Json
- JSON body extractor
- Keep
Alive - Keep-alive configuration for SSE connections
- Method
Router - HTTP method router for a single path
- Multipart
- Multipart form data extractor
- Multipart
Config - Configuration for multipart form handling
- Multipart
Field - A single field from a multipart form
- NoContent
- 204 No Content response
- Path
- Path parameter extractor
- Query
- Query string extractor
- Redirect
- Redirect response
- Request
- HTTP Request wrapper
- Request
Id - A unique identifier for a request
- Request
IdLayer - Middleware layer that generates a unique request ID for each request
- Route
- Represents a route definition that can be registered with .mount()
- Router
- Main router
- RustApi
- Main application builder for RustAPI
- Rust
ApiConfig - Configuration builder for RustAPI with auto-routes
- Sse
- Server-Sent Events response wrapper
- SseEvent
- A Server-Sent Event
- State
- State extractor
- Static
File - Static file response
- Static
File Config - Static file serving configuration
- Status
Code - An HTTP status code (
status-codein RFC 9110 et al.). - Stream
Body - A streaming body wrapper for HTTP responses
- Tracing
Layer - Middleware layer that creates tracing spans for requests
- Typed
- Typed path extractor
- Uploaded
File - File data wrapper for convenient access to uploaded files
- Validated
Json - Validated JSON body extractor
- With
Status - Generic wrapper for returning a response with a custom status code.
Enums§
- Body
Variant - Internal representation of the request body state
- Environment
- Environment configuration for error handling behavior
- Response
Body - Unified response body type
- Route
Match - Result of route matching
Traits§
- From
Request - Trait for extracting data from the full request (including body)
- From
Request Parts - Trait for extracting data from request parts (headers, path, query)
- Handler
- Trait representing an async handler function
- Into
Response - Trait for types that can be converted into an HTTP response
- Route
Handler - Trait for handlers with route metadata (generated by
#[rustapi::get], etc.) - Typed
Path - Trait for defining typed paths
- Validatable
- Unified validation trait for synchronous validation
Functions§
- collect_
auto_ routes - Collect all auto-registered routes.
- delete
- Create a DELETE route handler
- delete_
route - Create a DELETE route
- get
- Create a GET route handler
- get_
environment - Get the current environment (cached)
- get_
route - Create a GET route
- patch
- Create a PATCH route handler
- patch_
route - Create a PATCH route
- post
- Create a POST route handler
- post_
route - Create a POST route
- put
- Create a PUT route handler
- put_
route - Create a PUT route
- serve_
dir - Create a static file serving route
- sse_
response - Create an SSE response from a synchronous iterator of events