Expand description
High-level Rust API for Spikard.
This crate provides the ergonomic App interface that mirrors the
batteries-included experience available in the Python/Node/Ruby bindings.
Routes, DTO schemas, and advanced transports (WebSocket/SSE) are all backed
by the shared spikard-http runtime, ensuring identical validation and
middleware behaviour across languages.
Re-exports§
pub use upload::UploadFile;
Modules§
- testing
- upload
- File upload handling for multipart/form-data requests.
- validation
- JSON-RPC and request validation utilities.
Structs§
- App
- Spikard application builder.
- Compression
Config - Compression configuration shared across runtimes
- Cors
Config - CORS configuration for a route
- Rate
Limit Config - Rate limiting configuration shared across runtimes
- Request
Context - Wrapper around the raw request and validated metadata.
- Route
Builder - Builder for defining a route.
- Server
Config - Server configuration
- SseEvent
- An individual SSE event
- Static
Files Config - Static file serving configuration
Enums§
- AppError
- Error type for application builder operations.
- Handler
Response - Unified response type that can represent either a ready response or a streaming body.
- Hook
Result - Result of a lifecycle hook execution
- Method
- HTTP method
Traits§
- Into
Handler - Convert user-facing handler functions into the low-level
Handlertrait. - Lifecycle
Hook - Trait for lifecycle hooks on native targets (Send + Sync, Send futures).
- SseEvent
Producer - SSE event producer trait
- WebSocket
Handler - WebSocket message handler trait
Functions§
- add_
cors_ headers - Add CORS headers to a successful response
- delete
- Convenience helper for building a DELETE route.
- get
- Convenience helper for building a GET route.
- handle_
preflight - Handle CORS preflight (OPTIONS) request
- patch
- Convenience helper for building a PATCH route.
- post
- Convenience helper for building a POST route.
- put
- Convenience helper for building a PUT route.
- request_
hook - Create a request hook for the current target.
- response_
hook - Create a response hook for the current target.
- validate_
cors_ request - Validate a non-preflight CORS request
Type Aliases§
- Handler
Result - Result type for handlers
- Lifecycle
Hooks - Lifecycle
Hooks Builder