Skip to main content

Module axum

Module axum 

Source
Expand description

Axum HTTP/JSON API handlers

Modules§

routes

Structs§

CustomError 🔒
ErrorResponse 🔒
API error response — wire-compatible with the Custom variant of the per-module error enums (node::Error::Custom, merklized_state::Error::Custom, etc.) that all of tide-disco’s Error::catch_all calls produce. Most of our migrated endpoints (catchup, submit, state-signature, light-client, node, status, config, token, database) take that path, so this envelope is byte-identical with tide’s error response for them. Endpoints that use a specific variant directly (e.g. availability::Error::FetchLeaf) emit their own shape on tide; those bytes are not matched here.
SendQuery 🔒

Enums§

WsFormat 🔒
Wire format for a WebSocket stream — negotiated from the upgrade request’s Accept header to match tide-disco. surf-disco clients default to application/octet-stream, so production stream consumers expect VBS-encoded Message::Binary frames.

Functions§

classify_availability_error 🔒
Classify an anyhow::Error from an availability handler into the appropriate ApiError variant. Errors produced via AvailabilityError in the state implementation carry semantic meaning; everything else falls back to a 500 Internal Server Error.
create_combined_router
Create a combined router serving both v1 and v2 APIs
create_router_v1
Create v1 router without OpenAPI documentation (internal types)
create_router_v2
Create v2 router with OpenAPI documentation (proto types)
decode_body 🔒
Decode a request body based on its Content-Type, matching tide-disco’s body_auto behavior.
drive_ws_stream 🔒
encode_response 🔒
Encode a successful response body based on the request’s Accept header, matching tide-disco’s content negotiation.
redirect_to_docs 🔒
Redirect handler for root path
rewrite_root_to_v2 🔒
Middleware to rewrite root paths to /v2 paths
serve_openapi_spec 🔒
Serve the OpenAPI spec (extracted from Extension)
serve_swagger_ui 🔒
Serve custom Swagger UI with collapsed defaults
ws_format 🔒