Expand description
Prelude module - import everything you need with use rustapi_rs::prelude::*
Macros§
- debug
- Constructs an event at the debug level.
- error
- Constructs an event at the error level.
- info
- Constructs an event at the info level.
- route
- Helper macro to create a Route from a handler with RouteHandler trait
- trace
- Constructs an event at the trace level.
- warn
- Constructs an event at the warn level.
Structs§
- ApiError
- Standard API error type
- Body
- Raw body bytes extractor
- Client
Ip - Client IP address extractor
- Created
- 201 Created response wrapper
- Extension
- Extension extractor
- 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
- 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
- Stream
Body - A streaming body wrapper for HTTP responses
- Tracing
Layer - Middleware layer that creates tracing spans for requests
- 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.
Traits§
- Deserialize
- A data structure that can be deserialized from any data format supported by Serde.
- Into
Params - Trait used to convert implementing type to OpenAPI parameters.
- Into
Response - Trait for types that can be converted into an HTTP response
- Schema
- Trait for implementing OpenAPI Schema object.
- Serialize
- A data structure that can be serialized into any data format supported by Serde.
- Validate
- This is the original trait that was implemented by deriving
Validate. It will still be implemented for struct validations that don’t take custom arguments. The call is being forwarded to theValidateArgs<'v_a>trait.
Functions§
- delete
- Create a DELETE route handler
- delete_
route - Create a DELETE route
- get
- Create a GET route handler
- 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
Type Aliases§
Derive Macros§
- Deserialize
- Into
Params - Generate path parameters from struct’s fields.
- Schema
- Generate reusable OpenAPI schema to be used
together with
OpenApi. - Serialize
- Validate