Expand description
§blazingly-core
The runtime-neutral operation model of the Blazingly framework.
This crate defines the data the rest of the framework acts on: the typed
extractor and response wrappers handlers use (Json, Path, Query,
Header, Cookie, Form, Multipart, File; Created, Accepted,
NoContent, Status, WithHeaders), streaming, upgrade, upload, and
background-task primitives, a pull-based multipart/form-data reader, the
HTTP projection of a protocol-neutral operation (HttpMethod, HttpBinding,
OperationDescriptor), and the App builder that validates routes into a
deterministic AppDefinition. It re-exports the contract vocabulary of
blazingly-contract. There is no server, no async runtime, and no macro in
this crate.
It is an ordinary library and usable standalone: blazingly-executor,
blazingly-http, the native server, and the OpenAPI, docs, and MCP crates
all consume it, and custom adapters or tooling over the operation model can
depend on it directly. The blazingly facade re-exports this crate at its
root and adds the attribute macros and the executor that turn plain functions
into operations.
§Direct use
use blazingly_core::{App, HttpMethod, OperationDescriptor, ResponseDescriptor};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let health = OperationDescriptor::new(
HttpMethod::Get,
"/health",
"health.read",
"Liveness probe",
None,
vec![ResponseDescriptor::success(200, None)],
)?;
let definition = App::new().route(health).build()?;
assert_eq!(definition.operations().len(), 1);
Ok(())
}build rejects duplicate operation ids and duplicate or ambiguous HTTP
bindings, so an AppDefinition that exists is one every adapter can trust.
§Links
Macros§
Structs§
- Accepted
- A successful HTTP 202 response.
- Agent
Policy - Protocol-neutral metadata used by MCP and other agent transports.
- App
- Builder for an application description.
- AppDefinition
- A validated, deterministic application description.
- Background
- A typed response carrying work that starts after its wire body is sent.
- Background
Task - One runtime-neutral task that begins after the response body is written.
- Background
Task Error - A failure produced by work scheduled after an HTTP response is sent.
- Body
Stream Error - One failure produced while an HTTP response body is being streamed.
- Compatibility
- Entry point for semantic contract comparison.
- Compatibility
Change - One deterministic compatibility finding.
- Compatibility
Report - Semantic compatibility report between two versions of one operation.
- Contract
Fingerprint - Stable SHA-256 identity of one canonical operation contract.
- Contract
Format Version - Version of the canonical Blazingly contract format.
- Cookie
- A typed HTTP cookie argument.
- Created
- A successful HTTP 201 response.
- Dependency
Descriptor - A typed dependency declared by an operation handler.
- Field
Descriptor - One field in an API model.
- Field
Violation - One typed model-validation failure.
- File
- A typed uploaded file argument.
- Form
- A typed
application/x-www-form-urlencodedrequest body. - Header
- A typed HTTP header argument.
- Http
Binding - The HTTP projection of a protocol-neutral operation contract.
- Http
Upgrade - A validated HTTP protocol switch plus its post-handshake session handler.
- Input
Descriptor - One typed operation argument and its HTTP extraction source.
- Json
- A typed JSON request body.
- McpTool
Descriptor - MCP tool semantics declared alongside an operation.
- Model
Descriptor - A complete model used by validation,
OpenAPI, MCP, and Markdown. - Multipart
- A typed
multipart/form-datarequest body. - Multipart
Field - One part of a streamed
multipart/form-databody. - Multipart
Part Headers - The
Content-Dispositionmetadata of one multipart part. - Multipart
Stream - A
multipart/form-datarequest body read part by part, chunk by chunk. - NoContent
- A successful HTTP 204 response without a body.
- Operation
Descriptor - A protocol-neutral operation paired with its HTTP projection.
- Operation
Failure - A typed domain failure shared by HTTP and MCP projections.
- Operation
Id - A stable, human-readable operation identity such as
users.create. - Path
- A typed path argument.
- Prepared
Json - A JSON response body the operation encoded itself.
- Query
- Typed URL query arguments.
- Response
Build Error - A response construction failure that must be redacted by transports.
- Response
Descriptor - A single successful or error response declared by an operation.
- Response
Header - A response header emitted without transport-specific dependencies.
- Security
Requirement - Security scheme and scopes required by one operation.
- Security
Scheme Descriptor - Named security scheme registered by an application.
- Status
- Overrides the successful status of another typed response.
- Streaming
Body - Typed streaming HTTP response body.
- Type
Descriptor - The type identity and schema captured by the Rust frontend.
- Upgrade
IoError - A transport error after an HTTP connection has switched protocols.
- Upload
File - Runtime-neutral buffered upload metadata.
- Validation
Errors - All model-validation failures collected in one pass.
- With
Headers - Adds response headers without changing the typed response body.
Enums§
- Build
Error - An invalid application graph.
- Compatibility
Impact - Compatibility impact of one semantic contract change.
- Confirmation
- Whether an agent must ask for confirmation before invoking an operation.
- Field
Metadata - Field metadata carried inside
ValidationRule::Custom. - Http
Method - HTTP methods supported by the operation frontend.
- Input
Source - The transport-neutral source of one operation argument.
- Multipart
Error - A failure produced while reading a
multipart/form-datarequest body. - Operation
Risk - Agent-visible risk associated with invoking an operation.
- Output
Exposure - How much operation output may be exposed to an agent.
- Schema
Kind - Transport-independent JSON shape.
- Security
Location - HTTP location used by an API-key security scheme.
- Security
Scheme Kind - Transport-independent description of an application security scheme.
- Validation
Rule - Validation generated as native Rust code by
#[api_model].
Constants§
- CURRENT_
CONTRACT_ FORMAT_ VERSION - The current canonical contract encoding version.
- MAX_
MULTIPART_ HEADER_ BYTES - Largest header block accepted for one
multipart/form-datapart. - MAX_
MULTIPART_ PARTS - Largest number of parts accepted in one
multipart/form-databody.
Traits§
- ApiConstrained
- A value type whose field rules are declared once and reused by name.
- ApiError
- A user-declared operation error with stable transport semantics.
- ApiModel
- A model that can describe and validate itself without runtime reflection.
- ApiSchema
- A Rust type that can participate in an operation schema.
- Background
Ext - Ergonomic after-response task decoration.
- Body
Stream - Runtime-neutral, pull-based response byte stream.
- Response
Ext - Ergonomic response decoration shared by typed success responses.
- Upgraded
Io
Functions§
- merge_
field_ validation_ errors - Records a field validator’s violations under the field it was declared on.
- merge_
validation_ errors - Prefixes nested model violations while preserving stable codes/messages.
- record_
response_ size - Records the encoded size of a body of shape
T. - response_
size_ hint - Returns the capacity to reserve for the next body of shape
T.
Type Aliases§
- Background
Future - Upgrade
Future - Upgrade
Handler - Upgrade
Read Future - Runtime-neutral byte I/O owned after an HTTP protocol upgrade.
- Upgrade
Write Future