Expand description
RPC payload types with JSON/CBOR dual format support.
This module provides lightweight RPC request/response types and format negotiation based on HTTP headers:
Content-Type: application/cborfor CBOR request bodiesContent-Type: application/json(default) for JSON request bodiesAccept: application/cborfor CBOR responsesAccept: application/json(default) for JSON responses
Structs§
- Accept
- Extracts the preferred response format from the
Acceptheader. - AppError
- A typed error that converts to an HTTP response via
IntoResponse. - AppResponse
- A response type that supports both JSON and CBOR serialization.
- Header
Vals - Extracts a bearer token from the
Authorizationheader and sharding id from theX-Shardheader. - Payload
Format - Request/response format pair derived from HTTP content negotiation headers.
- RpcError
- RPC error object.
- RpcRequest
- RPC request object.
- RpcResponse
- RPC response object.
Enums§
- Content
Type - Content format for request/response payloads.
- String
Or - A helper type that can represent either a raw string or a parsed value.