Skip to main content

Module prelude

Module prelude 

Source
Expand description

Prelude module for convenient imports.

Structs§

App
A configured web application.
AppBuilder
Builder for constructing an App.
AppConfig
Application configuration.
BasicAuth
HTTP Basic Authentication credentials extractor.
BearerToken
Bearer token extractor for Authorization: Bearer <token>.
Cookie
Cookie value extractor.
Cors
CORS middleware.
CorsConfig
Cross-Origin Resource Sharing (CORS) configuration.
Cx
The capability context for a task.
DefaultDependencyConfig
Default dependency configuration (cache per request).
DependencyOverrides
Dependency override registry (primarily for testing).
Depends
Dependency injection extractor.
Header
Header extractor for individual HTTP headers.
HttpError
HTTP error that produces a response.
Json
JSON body extractor.
NoCache
Disable caching for this dependency.
OAuth2PasswordBearer
OAuth2 password bearer security scheme extractor.
OpenApi
OpenAPI 3.1 document.
OpenApiBuilder
OpenAPI document builder.
Page
Generic paginated response payload.
Pagination
Pagination extractor: reads ?page= and ?per_page= from the query string.
Path
Path parameter extractor.
Query
Query string extractor.
Request
HTTP request.
RequestContext
Request context that wraps asupersync’s capability context.
RequestId
A request ID that was extracted or generated for the current request.
RequestIdMiddleware
Middleware that adds unique request IDs to requests and responses.
Response
HTTP response.
Route
A route definition used for routing and (optionally) metadata.
Router
Radix trie router.
Server
Synchronous HTTP server for request/response conversion.
ServerConfig
Server configuration for the HTTP/1.1 server.
State
State extractor for application-wide shared state.
StatusCode
HTTP status code.
ValidationError
A single validation error item.
ValidationErrors
Collection of validation errors (422 Unprocessable Entity response).

Enums§

DependencyScope
Dependency resolution scope.
Method
HTTP method.

Traits§

DependsConfig
Configuration for Depends resolution.
Deserialize
A data structure that can be deserialized from any data format supported by Serde.
FromDependency
Trait for types that can be injected as dependencies.
FromRequest
Trait for types that can be extracted from a request.
IntoResponse
Trait for types that can be converted into a response.
Serialize
A data structure that can be serialized into any data format supported by Serde.

Functions§

serve
Convenience function to serve an App on the given address.

Type Aliases§

DefaultConfig
Backwards-friendly alias for the default config.

Attribute Macros§

delete
Mark a function as a DELETE handler.
get
Mark a function as a GET handler.
head
Mark a function as a HEAD handler.
options
Mark a function as an OPTIONS handler.
patch
Mark a function as a PATCH handler.
post
Mark a function as a POST handler.
put
Mark a function as a PUT handler.

Derive Macros§

Deserialize
JsonSchema
Derive JSON Schema for OpenAPI.
Serialize
Validate
Derive validation for a struct.