Skip to main content

Crate blazingly_esp_idf

Crate blazingly_esp_idf 

Source
Expand description

§blazingly-esp-idf

Fixed-capacity HTTP API layer for ESP-IDF-class devices, with a FastAPI-shaped surface: path/query/header/JSON extractors, validation errors, routers, middleware, and OpenAPI export — under hard memory budgets.

§Capabilities

  • App builder: get / post / mount / middleware / /openapi.json
  • Path templates /items/{id}, query & header helpers, req.json::<T>()
  • HttpError → JSON 4xx/422 like validation failures
  • Host TCP and ESP-IDF QEMU firmware path

See the crate README for the FastAPI comparison matrix.

Re-exports§

pub use app::App;
pub use app::BuildError;
pub use app::Router;
pub use capacities::Capacities;
pub use error::finish;
pub use error::ErrorBody;
pub use error::HandlerResult;
pub use error::HttpError;
pub use fixed_buf::FixedBuf;
pub use middleware::AfterMiddleware;
pub use middleware::AfterMiddlewareStack;
pub use middleware::BeforeMiddleware;
pub use middleware::DefaultHeaders;
pub use middleware::MiddlewareOutcome;
pub use middleware::MiddlewareStack;
pub use middleware::MAX_AFTER_MIDDLEWARE;
pub use middleware::MAX_DEFAULT_HEADERS;
pub use middleware::MAX_MIDDLEWARE;
pub use path_match::match_path;
pub use path_match::PathParams;
pub use path_match::MAX_PATH_PARAMS;
pub use provision::parse_sta_form;
pub use provision::sta_from_request;
pub use provision::sta_from_request_auto;
pub use provision::CAPTIVE_HTML;
pub use provision::DEFAULT_SOFTAP_SSID;
pub use provision::NVS_KEY_PASS;
pub use provision::NVS_KEY_SSID;
pub use provision::NVS_NAMESPACE;
pub use request::percent_decode_owned;
pub use request::RequestView;
pub use routes::box_handler;
pub use routes::box_result_handler;
pub use routes::with_state;
pub use routes::BoxedFallibleHandler;
pub use routes::BoxedHandler;
pub use routes::FallibleHandlerFn;
pub use routes::HandlerFn;
pub use routes::ResponseParts;
pub use routes::RouteDocs;
pub use routes::RouteError;
pub use routes::RouteTable;
pub use serve_hooks::SequentialHooks;
pub use server::Server;
pub use socket::Connection;
pub use socket::Listener;
pub use state::AppState;
pub use state::StateError;
pub use state::MAX_RESOURCES;
pub use mqtt_lite::MqttClient;
pub use mqtt_lite::MqttConfig;
pub use security::require_softap_password;
pub use security::SecurityProfile;
pub use telemetry::MqttSink;
pub use telemetry::TelemetrySink;
pub use telemetry::UdpSink;
pub use host::HostConnection;
pub use host::HostListener;
pub use wifi::SoftApConfig;
pub use wifi::StaConfig;
pub use wifi::WifiConfigError;
pub use self;
pub use blazingly_contract;
pub use blazingly_json;

Modules§

app
FastAPI-style application builder: routes, prefix mount, middleware, OpenAPI.
capacities
Compile-time resource budgets for the ESP product profile.
contract_lite
Blazingly Contract Lite on device: stable operation list + /contract.json.
control_plane
One-shot control-plane assembly: policy + logging + killers on an App.
discovery
Device discovery plan: mDNS hostname + TXT without binding to esp-idf mdns.
error
HTTP application errors with FastAPI-like JSON bodies.
esp_idf
ESP-IDF notes and re-exports for device firmware.
fixed_buf
Fixed-capacity byte buffer with std::io::Write for response encoding.
host
Host TCP adapter for feasibility work without espup or hardware.
identity
Device identity + mDNS discovery helpers + optional HMAC for config payloads.
middleware
Before/after middleware chains (auth, default headers, early reject).
mqtt_lite
Minimal MQTT 3.1.1 client for telemetry PUBLISH (QoS 0).
openapi
Minimal OpenAPI 3.0 JSON export from the route table (FastAPI-like docs surface).
ota
Safe OTA handoff endpoints — not a full OTA engine.
path_match
Path template matching: /items/{id} against /items/42.
peer_ctx
Per-connection peer address context (thread-local).
policy
Policy middleware pack: API key, per-path body limits, optional path allowlist.
provision
SoftAP captive provisioning helpers (HTML + form parse + NVS key names).
rate_limit
Global token-bucket rate limit (SoftAP / open LAN protection).
request
Request view + FastAPI-style extractors (path, query, header, JSON).
request_log
Structured request logging + x-request-id correlation.
routes
Route table with path templates, static files, HEAD/OPTIONS, response helpers.
security
Plant-safe security defaults for the control plane.
serve_hooks
Hooks for the sequential accept loop (watchdog, Wi‑Fi reconnect checks).
server
Fixed-buffer HTTP/1 connection loop using blazingly-wire only (no Compio).
socket
Socket boundary: no Compio, no executor — just bytes in and out.
state
Process-wide application state (FastAPI-ish app.state without DI graph).
telemetry
Lightweight telemetry out-plane (HTTP stays for control).
wifi
Wi-Fi station / SoftAP configuration and ESP-IDF connect helpers.

Enums§

Method
Standard HTTP methods accepted by the current parser.