Imported from zhoudongchao9-cloud/blueprint-repl (
crates/core/AGENTS.md). Install upstream withnpx skills add zhoudongchao9-cloud/blueprint-repl --skill core. Copyright stays with the author.
core
Purpose
Crate blueprint-core: Foundation crate defining the job system primitives that the entire Blueprint SDK builds upon. Provides the Job trait, JobCall request type (modeled after HTTP's Request), JobResult response type, extraction traits (FromJobCall, FromJobCallParts), extension traits for job call manipulation, and feature-gated tracing macros. Designed as a no_std crate with alloc support.
Contents (one hop)
Subdirectories
-
docs/- Developer documentation:jobs_intro.md(job system introduction),debugging_job_type_errors.md(troubleshooting guide for job type errors). -
src/- Core modules:job/(Job trait, JobCall, JobResult, JobId),extract/(FromJobCall, FromJobCallParts extraction traits),ext_traits/(extension traits for job call parts),error.rs,extensions.rs(type-map extensions),metadata.rs,macros.rs(internal helper macros).
Files
CHANGELOG.md- Version history.Cargo.toml- Crate manifest (blueprint-core). Deps:bytes,futures-util,pin-project-lite,tower,hashbrown,tiny-keccak,tracing. Features:std,tracing.README.md- Crate documentation.
Key APIs (no snippets)
Jobtrait -- defines a blueprint job handler that processesJobCallrequests.JobCall-- the request type for job invocations, containing headers, extensions, and a body (similar to HTTP Request).JobResult-- the response type for job completions.JobId-- unique identifier for a job type.FromJobCall/FromJobCallParts-- extraction traits for pulling typed data from job calls (similar to Axum extractors).IntoJobResult/IntoJobResultParts-- conversion traits for producing job results.JobCallExt/JobCallPartsExt-- extension traits for manipulating job call components.Error-- core error type.- Tracing macros (
info!,warn!,error!,debug!,trace!) -- feature-gated wrappers aroundtracingthat compile to no-ops when thetracingfeature is disabled.
Relationships
- Foundation dependency for nearly every other crate in the workspace.
- Depended on by
blueprint-runner,blueprint-router,blueprint-clients,blueprint-auth,blueprint-faas,blueprint-remote-providers, and more. - Uses
towerfor service composition patterns. no_stdcompatible withalloc, making it usable in constrained environments.