Expand description
Common infrastructure for HTTP and WebSocket server subsystems.
This crate provides shared types and utilities used by sub-server-http and
sub-server-ws. It includes:
- Authentication: Identity extraction from headers and tokens
- Execution: Async wrappers around synchronous database operations
- Response: Frame conversion for JSON serialization
- Runtime: Shared tokio runtime management
- State: Application state for request handlers
Structs§
- AppState
- Shared application state passed to all request handlers.
- Query
Config - Configuration for query execution.
- Response
Column - A column in a response frame.
- Response
Frame - A response frame containing query/command results.
- Shared
Runtime - Shared tokio runtime for all network subsystems.
Enums§
- Auth
Error - Authentication error types.
- Execute
Error - Error types for query/command execution.
Functions§
- anonymous_
identity - Create an anonymous identity for unauthenticated requests.
- convert_
frames - Convert database result frames to response frames.
- execute_
command - Execute a command on the blocking thread pool with timeout.
- execute_
command_ single - Execute a single command statement on the blocking thread pool with timeout.
- execute_
query - Execute a query on the blocking thread pool with timeout.
- execute_
query_ single - Execute a single query statement on the blocking thread pool with timeout.
- extract_
identity_ from_ api_ key - Extract identity from an API key.
- extract_
identity_ from_ auth_ header - Extract identity from HTTP Authorization header value.
- extract_
identity_ from_ ws_ auth - Extract identity from WebSocket authentication message.
- get_
num_ cpus - Returns the number of available CPUs of the current system.
- root_
identity - Create a root system identity.
Type Aliases§
- Auth
Result - Result type for authentication operations.
- Execute
Result - Result type for execute operations.