Expand description
§RustAPI Core
Core library providing the foundational types and traits for RustAPI.
This crate is not meant to be used directly. Use rustapi-rs instead.
Macros§
- route
- Helper macro to create a Route from a handler with RouteHandler trait
Structs§
- ApiError
- Standard API error type
- Body
- Raw body bytes extractor
- Created
- 201 Created response wrapper
- Handler
Service - Wrapper to convert a Handler into a tower Service
- Html
- HTML response wrapper
- Json
- JSON body extractor
- Method
Router - HTTP method router for a single path
- NoContent
- 204 No Content response
- Path
- Path parameter extractor
- Query
- Query string extractor
- Redirect
- Redirect response
- Request
- HTTP Request wrapper
- Route
- Represents a route definition that can be registered with .mount()
- Router
- Main router
- RustApi
- Main application builder for RustAPI
- State
- State extractor
- Validated
Json - Validated JSON body extractor
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.)
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