Crate skyzen

Crate skyzen 

Source
Expand description

A simple and fast web server framework.

Re-exports§

pub use static_files::StaticDir;
pub use websocket::WebSocket;
pub use websocket::WebSocketReceiver;
pub use websocket::WebSocketSender;
pub use websocket::WebSocketUpgrade;

Modules§

extract
Extract strong-typed object from your request.
handler
Handle the request and make a response.
header
HTTP header types
middleware
Utility for writing middleware.
openapi
OpenAPI helpers. OpenAPI helpers powered by utoipa schemas.
responder
Modify response or make a response,but in a strong-typed way.
routing
Tree-based routing primitives.
runtime
Runtime primitives leveraged by #[skyzen::main]. Runtime utilities used by #[skyzen::main].
static_files
Static asset helpers for building file servers.
utils
Utilities.
websocket
WebSocket support for both native and WASM targets.

Structs§

Body
Flexible HTTP body that can represent data in various forms.
Error
A concrete error type for HTTP operations.
IgnoreOpenApi
Wrapper that explicitly opts out of OpenAPI schema generation for contained extractors or responders.
Method
The Request Method (VERB)
OpenApi
Minimal OpenAPI representation for Skyzen routers.
OpenApiOperation
Description of a single handler operation.
Route
Collection of route nodes anchored at a path prefix.
StatusCode
An HTTP status code (status-code in RFC 9110 et al.).
Uri
The URI component of a request.

Enums§

BodyError
Error type for body operations.
WebSocketMessage
Message transmitted over a websocket connection.

Traits§

CreateRouteNode
Builder extension that turns a path literal into convenient routing nodes.
Endpoint
A trait for types that can handle HTTP requests and generate responses.
HttpError
Trait for errors that have an associated HTTP status code.
Middleware
Trait for implementing middleware that can process HTTP requests and responses.
PartialSchema
Trait used to implement only Schema part of the OpenAPI doc.
Responder
Transform a object into a part of HTTP response,always is response body,header,etc.
ResultExt
Extension trait for Result and Option to set HTTP status code on error.
Server
Abstraction over HTTP server backends.
ToSchema
Trait for implementing OpenAPI Schema object.

Type Aliases§

BoxHttpError
A boxed HTTP error trait object.
Request
A type alias for HTTP requests with a custom Body type.
Response
A type alias for HTTP responses with a custom Body type.
Result
Result type used in skyzen.

Attribute Macros§

error
Attribute & derive macros exported by Skyzen. Error helper that implements Display, Error, and HttpError.
main
Attribute & derive macros exported by Skyzen. Attribute macro that boots a Skyzen Endpoint on native or wasm runtimes.
openapi
Attribute & derive macros exported by Skyzen. Annotate handlers that should appear in generated OpenAPI documentation.

Derive Macros§

HttpError
Attribute & derive macros exported by Skyzen. Derive helper that maps enum variants to HTTP status codes.
ToSchema
Generate reusable OpenAPI schema to be used together with OpenApi.