Expand description
Spikard HTTP Server
Pure Rust HTTP server with language-agnostic handler trait. Language bindings (Python, Node, WASM) implement the Handler trait.
Re-exports§
pub use asyncapi::AsyncApiConfig;pub use asyncapi::ParseResult;pub use asyncapi::ParsedChannel;pub use asyncapi::ParsedMessage;pub use asyncapi::ParsedOperation;pub use asyncapi::ValidateRequest;pub use asyncapi::ValidationResponse;pub use asyncapi::parse_asyncapi_value;pub use asyncapi::validate_message;pub use auth::Claims;pub use auth::api_key_auth_middleware;pub use auth::jwt_auth_middleware;pub use background::BackgroundHandle;pub use background::BackgroundJobError;pub use background::BackgroundJobMetadata;pub use background::BackgroundTaskConfig;pub use grpc::GrpcConfig;pub use handler_response::HandlerResponse;pub use handler_trait::Handler;pub use handler_trait::HandlerResult;pub use handler_trait::RequestData;pub use handler_trait::StaticResponse;pub use handler_trait::StaticResponseHandler;pub use handler_trait::ValidatedParams;pub use jsonrpc::JsonRpcConfig;pub use lifecycle::LifecycleHooks;pub use lifecycle::LifecycleHooksBuilder;pub use lifecycle::request_hook;pub use lifecycle::response_hook;pub use openapi::ContactInfo;pub use openapi::LicenseInfo;pub use openapi::OpenApiConfig;pub use openapi::SecuritySchemeInfo;pub use openapi::ServerInfo;pub use response::Response;pub use server::Server;pub use sse::SseEvent;pub use sse::SseEventProducer;pub use sse::SseState;pub use sse::sse_handler;pub use testing::ResponseSnapshot;pub use testing::SnapshotError;pub use testing::snapshot_response;pub use websocket::WebSocketHandler;pub use websocket::WebSocketState;pub use websocket::websocket_handler;
Modules§
- asyncapi
- AsyncAPI v3 HTTP endpoints and spec parsing
- auth
- Authentication middleware for JWT and API keys.
- background
- bindings
- cors
- CORS (Cross-Origin Resource Sharing) handling
- grpc
- gRPC runtime support for Spikard
- handler_
response - handler_
trait - Handler trait for language-agnostic request handling
- jsonrpc
- JSON-RPC protocol support for Spikard HTTP
- lifecycle
- openapi
- OpenAPI 3.1.0 specification generation
- response
- HTTP Response types
- server
- HTTP server implementation using Tokio and Axum
- sse
- Server-Sent Events (SSE) support for Spikard
- testing
- websocket
- WebSocket support for Spikard
Structs§
- ApiKey
Config - API Key authentication configuration
- Compression
Config - Compression configuration shared across runtimes
- Cors
Config - CORS configuration for a route
- Json
RpcMethod Info - JSON-RPC method metadata for routes that support JSON-RPC
- JwtConfig
- JWT authentication configuration
- Parameter
Validator - Parameter validator that uses JSON Schema
- Problem
Details - RFC 9457 Problem Details for HTTP APIs
- Rate
Limit Config - Rate limiting configuration shared across runtimes
- Route
- Route definition with compiled validators
- Route
Metadata - Route metadata extracted from bindings
- Schema
Registry - Global schema registry for compiled validators
- Schema
Validator - Schema validator that compiles and validates JSON Schema
- Server
Config - Server configuration
- Server
Config Builder - Builder for ServerConfig
- Static
Files Config - Static file serving configuration
- Structured
Error - Canonical error payload: { error, code, details }.
- Validation
Error - Validation error containing one or more validation failures
- Validation
Error Detail - Individual validation error detail (FastAPI-compatible format)
Enums§
- Hook
Result - Result of a lifecycle hook execution
- Method
- HTTP method
- Parameter
Source - Parameter source - where the parameter comes from
Constants§
- CONTENT_
TYPE_ PROBLEM_ JSON - Reexport from spikard_core for convenience Content-Type for RFC 9457 Problem Details
Traits§
- Lifecycle
Hook - Trait for lifecycle hooks on native targets (Send + Sync, Send futures).
Functions§
- build_
server_ runtime - Build a Tokio runtime for serving HTTP requests with the configured worker count.