arcly_http_core/transport.rs
1//! Transport-agnostic envelope + error types shared across the request
2//! pipeline and the messaging subsystem.
3//!
4//! These live in `core` (not the `messaging` crate) because `pipeline`
5//! continues a producer's trace from an [`InboundMessage`] and the audit
6//! pipeline reports a boxed [`BoxError`] — both core concerns that must not
7//! pull in the optional `arcly-http-messaging` crate. The messaging crate
8//! re-exports them, so `arcly_http::messaging::InboundMessage` keeps resolving.
9
10/// One inbound message, transport-agnostic.
11#[derive(Clone, Debug)]
12pub struct InboundMessage {
13 pub topic: String,
14 pub payload: serde_json::Value,
15 /// Consumers dedupe on this under at-least-once delivery.
16 pub idempotency_key: String,
17 pub tenant: Option<String>,
18 /// W3C trace context stamped by the producer (outbox), if any.
19 pub traceparent: Option<String>,
20}
21
22/// Boxed error for infrastructure trait contracts (transports, sinks,
23/// publishers). `String` and `&str` convert via `.into()`, so simple
24/// implementations stay simple while real ones keep their source chain.
25pub type BoxError = Box<dyn std::error::Error + Send + Sync>;