Expand description
typeway-server — Tower/Hyper server integration for the Typeway web framework.
This crate provides the HTTP server layer: handler dispatch, request extraction, response encoding, and the type-safe server builder.
Re-exports§
pub use body::body_from_stream;pub use body::empty_body;pub use body::sse_body;pub use body::BoxBody;pub use effects::EffectfulLayeredServer;pub use effects::EffectfulServer;pub use error::JsonError;pub use extract::Cookie;pub use extract::CookieJar;pub use extract::Extension;pub use extract::FromRequest;pub use extract::FromRequestParts;pub use extract::Header;pub use extract::NamedCookie;pub use extract::NamedHeader;pub use extract::Path;pub use extract::PathPrefixOffset;pub use extract::Query;pub use extract::State;pub use handler::into_boxed_handler;pub use handler::BoxedHandler;pub use handler::Handler;pub use handler::ResponseFuture;pub use handler_for::bind;pub use handler_for::BindableEndpoint;pub use handler_for::BoundHandler;pub use mount::ServerBuilder;pub use negotiate::AcceptHeader;pub use negotiate::CsvFormat;pub use negotiate::HtmlFormat;pub use negotiate::JsonFormat;pub use negotiate::NegotiateFormats;pub use negotiate::NegotiatedResponse;pub use negotiate::RenderAs;pub use negotiate::RenderAsXml;pub use negotiate::TextFormat;pub use negotiate::XmlFormat;pub use response::IntoResponse;pub use response::Json;pub use router::Router;pub use router::RouterService;pub use secure_headers::SecureHeadersLayer;pub use server::serve;pub use server::LayeredServer;pub use server::Server;pub use serves::Serves;pub use serves::SubApi;pub use sse::keep_alive;pub use sse::SseEvent;pub use sse::SseResponse;pub use tower_http;pub use tracing;
Modules§
- auth
- Type-level authentication for endpoints.
- body
- Shared body type used throughout the server.
- effects
- Server-side middleware effects tracking.
- error
- Structured error responses and error-handling utilities.
- extract
- Request extraction traits and built-in extractors.
- handler
- The
Handlertrait — connects async functions to HTTP routes via extractors. - handler_
for - Bridge between typed handlers and the runtime router.
- mount
- Builder-style API composition with
.mount(). - negotiate
- Content negotiation engine and format wrappers.
- production
- Production deployment patterns for typeway servers.
- request_
id - Request ID middleware — assigns a unique ID to each request.
- response
- The
IntoResponsetrait and implementations. - router
- The runtime
Routerthat matches incoming requests to handlers. - secure_
headers - Security headers middleware — adds standard security headers to every response.
- server
- The type-safe
Serverbuilder andserveconvenience function. - serves
- The
Servestrait — compile-time check that a handler tuple covers an API. - sse
- Server-Sent Events response support.
- typed
- Type-level endpoint wrappers for compile-time enforcement.
- typed_
bind - Bind functions for typed endpoint wrappers.
- typed_
response - Typed response wrapper for compile-time return type enforcement.
Macros§
- bind
- Convenience macro to bind a handler to an endpoint without turbofish.
- bind_
auth - Convenience macro for binding protected handlers.
- bind_
content_ type - Bind a handler with content-type enforcement.
- bind_
strict - Convenience macro for binding strict handlers.
- bind_
validated - Bind a handler with body validation.
- handler_
docs - Collect handler doc constants into a slice for [
Server::with_openapi_docs].