Expand description
Core HTTP layer of siderite: application builder, routing, extraction, responses, dependency injection, middleware and RFC 7807 errors.
The underlying HTTP engine is an internal implementation detail; the public API consists of siderite-owned types and traits. Every extractor and response type can document itself, so OpenAPI operations are derived from handler signatures.
Re-exports§
pub use app::App;pub use app::AppMeta;pub use app::DocsConfig;pub use background::BackgroundTaskError;pub use background::BackgroundTaskLimits;pub use background::BackgroundTasks;pub use background::Task;pub use background::TaskId;pub use background::TaskQueue;pub use background::TaskQueueError;pub use body::Body;pub use body::DEFAULT_BODY_LIMIT;pub use di::Dependency;pub use di::DependencyError;pub use di::Depends;pub use di::Provided;pub use di::RequestHead;pub use di::ResolveContext;pub use error::ApiError;pub use error::ApiResult;pub use error::BodyError;pub use error::ServerError;pub use extract::FromRequest;pub use extract::FromRequestParts;pub use extract::Path;pub use extract::Query;pub use extract::RawRequest;pub use extract::Request;pub use form::DEFAULT_MULTIPART_LIMIT;pub use form::Form;pub use form::Multipart;pub use form::MultipartField;pub use handler::Handler;pub use header::Accept;pub use header::Cookies;pub use header::Header;pub use header::NamedHeader;pub use header::SameSite;pub use header::SetCookie;pub use header::UserAgent;pub use header::WithCookies;pub use lifespan::Lifespan;pub use lifespan::ManagedLifespan;pub use lifespan::Resource;pub use middleware::BodyLimit;pub use middleware::BoxService;pub use middleware::Compression;pub use middleware::ConcurrencyLimit;pub use middleware::ConcurrencyLimitError;pub use middleware::ConcurrencyStats;pub use middleware::Cors;pub use middleware::HttpsRedirect;pub use middleware::Next;pub use middleware::RateLimit;pub use middleware::RateLimitError;pub use middleware::RequestId;pub use middleware::RequestIdLayer;pub use middleware::RequestLogging;pub use middleware::Timeout;pub use middleware::TrustedHosts;pub use middleware::TrustedProxies;pub use middleware::from_fn;pub use middleware::CsrfOrigin;pub use middleware::CsrfOriginError;pub use pagination::CursorPage;pub use pagination::CursorParams;pub use pagination::Page;pub use pagination::PageParams;pub use response::Html;pub use response::IntoResponse;pub use response::Json;pub use response::JsonDump;pub use response::NoContent;pub use response::PlainText;pub use response::Response;pub use response::WithStatus;pub use responses::Cached;pub use responses::FileResponse;pub use responses::Redirect;pub use responses::StreamingResponse;pub use responses::WithHeaders;pub use routing::MethodRouter;pub use routing::OperationMeta;pub use routing::Route;pub use routing::delete;pub use routing::get;pub use routing::head;pub use routing::options;pub use routing::patch;pub use routing::post;pub use routing::put;pub use security::ApiKey;pub use security::ApiKeyLocation;pub use security::ApiKeySpec;pub use security::Authenticate;pub use security::HttpBasic;pub use security::HttpBearer;pub use security::NoScopes;pub use security::OAuth2PasswordBearer;pub use security::OAuth2PasswordRequestForm;pub use security::OAuth2Spec;pub use security::Scopes;pub use security::Security;pub use service::RouterService;pub use sse::Sse;pub use state::State;pub use ws::CloseFrame;pub use ws::Message;pub use ws::WebSocket;pub use ws::WebSocketResponse;pub use ws::WebSocketUpgrade;pub use ws::WsError;
Modules§
- app
- The
Appbuilder. - background
- Bounded process-local tasks authorized by successful endpoint responses.
- body
- Opaque HTTP body type.
- di
- Dependency injection (
Depends), inspired by FastAPI. - error
- Error types: RFC 7807 problem details, server and body errors.
- extract
- Request extraction.
- form
- Form and multipart body extractors.
- handler
- The
Handlertrait: async functions usable as endpoints. - header
- Typed header and cookie extractors and
Set-Cookieresponses. - health
- Opt-in health routes: process liveness
(
App::routes([liveness("/livez")])) and readiness with bounded application checks (readiness). - http
- Re-exports of standard HTTP types used in the public API.
- lifespan
- Application lifespan: startup/shutdown hooks and scoped resources.
- middleware
- Middleware: tower layers over the whole application, plus batteries.
- pagination
- Page-number pagination over HTTP:
PageParamsreads and checks?page=N&per_page=M, andPageis the response body. - response
- Responses.
- responses
- Redirect, streaming, file and header-decorated responses.
- routing
- Method routers and per-operation metadata.
- security
- Security schemes as self-documenting extractors: HTTP Bearer, HTTP Basic, API keys and the OAuth2 password flow.
- service
- Opaque tower service produced from an
App. - sse
- Server-sent events:
Eventencodes one event of thetext/event-streamformat, andSsestreams events as a response. - state
- Shared application state extractor.
- static_
files - Static file serving, and single-page application mounts.
- ws
- WebSocket upgrade and connection handling.
Macros§
Structs§
- Readiness
- Extractor and shareable handle for application readiness probes.
- Server
Limits - Hard transport admission bounds applied by
App::run.
Enums§
- Server
Phase - Observable phase of the root application lifecycle.