objectstore_server/batch.rs
1//! HTTP header names used in batch request and response processing.
2//!
3//! These headers carry per-operation metadata in the multipart bodies of batch
4//! requests and responses. Clients include [`HEADER_BATCH_OPERATION_KEY`] and
5//! [`HEADER_BATCH_OPERATION_KIND`] on each request part; the server echoes all
6//! three — including [`HEADER_BATCH_OPERATION_INDEX`] — on each response part
7//! so clients can correlate results with their original operations.
8
9/// Zero-based position of this operation within the batch, set by the server on response parts.
10///
11/// Clients use this to match each response part back to its corresponding request operation.
12pub const HEADER_BATCH_OPERATION_INDEX: &str = "x-sn-batch-operation-index";
13
14/// Object key for this batch operation, required on request parts.
15///
16/// The key is escaped with [`encode_header_value`](objectstore_types::headers::encode_header_value)
17/// so that keys containing characters a header value cannot carry — non-ASCII in particular — still
18/// survive the transport.
19pub const HEADER_BATCH_OPERATION_KEY: &str = "x-sn-batch-operation-key";
20
21/// Operation kind for this batch part: `"get"`, `"insert"`, or `"delete"`.
22pub const HEADER_BATCH_OPERATION_KIND: &str = "x-sn-batch-operation-kind";