Expand description
Framework-agnostic response envelope + error taxonomy for SNAP BI.
This crate is the response half of the SNAP BI spine (the crypto half lives
in kamu-snap-crypto). It exposes:
SnapResponse<T>— typed envelope + optional typed payload with spec-compliant flat JSON wire shape.SnapEnvelope— the envelope fields (responseCode+responseMessage).Error— the 61-variant SNAP BI error taxonomy plus a feature-gatedCryptobridge (featurecrypto).Category— coarse retry/policy classification.ResponseCode— wire newtype with defensive parsing + an inverse classifier that maps received codes back toErrorvariants.ServiceCode— validated 0..=99 newtype.
§Framework support
This crate is framework-free. The Responder (actix-web) and
IntoResponse (axum) impls live in the per-framework adapter crates
(kamu-snap-response-actix, kamu-snap-response-axum).
§Feature flags
crypto(default off) — enables theError::Cryptovariant which wraps akamu_snap_crypto::Errorfor server-side handlers that propagate crypto failures into the SNAP error taxonomy.
Re-exports§
pub use category::Category;pub use envelope::SnapEnvelope;pub use envelope::SnapResponse;pub use error::Error;pub use response_code::ResponseCode;pub use response_code::ServiceCode;
Modules§
- category
- Coarse error category — used by retry policy / logging / dashboards.
- envelope
- Wire envelope + the generic
SnapResponse<T>. - error
- SNAP BI error taxonomy.
- response_
code - Wire-level
responseCodenewtype + theServiceCodeconstrainedu8.