Skip to main content

siderite_core/
lib.rs

1//! Core HTTP layer of siderite: application builder, routing, extraction,
2//! responses, dependency injection, middleware and RFC 7807 errors.
3//!
4//! The underlying HTTP engine is an internal implementation detail; the
5//! public API consists of siderite-owned types and traits. Every extractor
6//! and response type can document itself, so OpenAPI operations are derived
7//! from handler signatures.
8#![forbid(unsafe_code)]
9
10pub mod app;
11pub mod background;
12pub mod body;
13pub mod di;
14pub mod error;
15pub mod extract;
16pub mod form;
17pub mod handler;
18pub mod header;
19pub mod health;
20pub mod lifespan;
21pub mod middleware;
22pub mod pagination;
23pub mod response;
24pub mod responses;
25pub mod routing;
26pub mod security;
27mod server;
28pub mod service;
29pub mod sse;
30pub mod state;
31pub mod static_files;
32pub mod ws;
33
34pub use app::{App, AppMeta, DocsConfig};
35pub use background::{
36    BackgroundTaskError, BackgroundTaskLimits, BackgroundTasks, Task, TaskId, TaskQueue,
37    TaskQueueError,
38};
39pub use body::{Body, DEFAULT_BODY_LIMIT};
40pub use di::{Dependency, DependencyError, Depends, Provided, RequestHead, ResolveContext};
41pub use error::{ApiError, ApiResult, BodyError, ServerError};
42pub use extract::{FromRequest, FromRequestParts, Path, Query, RawRequest, Request};
43pub use form::{DEFAULT_MULTIPART_LIMIT, Form, Multipart, MultipartField};
44pub use handler::Handler;
45pub use header::{
46    Accept, Cookies, Header, NamedHeader, SameSite, SetCookie, UserAgent, WithCookies,
47};
48pub use lifespan::{Lifespan, ManagedLifespan, Resource};
49pub use middleware::{
50    BodyLimit, BoxService, Compression, ConcurrencyLimit, ConcurrencyLimitError, ConcurrencyStats,
51    Cors, HttpsRedirect, Next, RateLimit, RateLimitError, RequestId, RequestIdLayer,
52    RequestLogging, Timeout, TrustedHosts, TrustedProxies, from_fn,
53};
54pub use middleware::{CsrfOrigin, CsrfOriginError};
55pub use pagination::{CursorPage, CursorParams, Page, PageParams};
56pub use response::{
57    Html, IntoResponse, Json, JsonDump, NoContent, PlainText, Response, WithStatus,
58};
59pub use responses::{Cached, FileResponse, Redirect, StreamingResponse, WithHeaders};
60pub use routing::{
61    MethodRouter, OperationMeta, Route, delete, get, head, options, patch, post, put,
62};
63pub use security::{
64    ApiKey, ApiKeyLocation, ApiKeySpec, Authenticate, HttpBasic, HttpBearer, NoScopes,
65    OAuth2PasswordBearer, OAuth2PasswordRequestForm, OAuth2Spec, Scopes, Security,
66};
67pub use server::{Readiness, ServerLimits, ServerPhase};
68pub use service::RouterService;
69pub use sse::Sse;
70pub use state::State;
71pub use ws::{CloseFrame, Message, WebSocket, WebSocketResponse, WebSocketUpgrade, WsError};
72
73/// Re-exports of standard HTTP types used in the public API.
74pub mod http {
75    pub use http::{HeaderMap, HeaderName, HeaderValue, Method, StatusCode, Uri, header};
76}