pub struct SpooledBody {
pub path: PathBuf,
pub size: u64,
pub md5_hex: String,
pub sha256_hex: String,
pub md5: [u8; 16],
pub sha256: [u8; 32],
pub trailers: Vec<(String, String)>,
}Expand description
Outcome of spooling a streaming request body to disk: the path of the
freshly created tempfile, the total byte count, and the MD5 hash of
the bytes (lowercase hex, the form S3 uses for ETag).
The caller owns the file and is responsible for either consuming it
(passing the PathBuf into a BodySource::File handed to a store)
or unlinking it. Returning the file path instead of a handle lets the
downstream store rename the file directly, which is the whole point —
in disk-mode S3 a 1 GiB upload performs zero in-RAM copies of the
payload.
Fields§
§path: PathBuf§size: u64§md5_hex: String§sha256_hex: StringLowercase-hex SHA-256 of the decoded payload, computed in the same
single streaming pass as the MD5. Lets the S3 layer verify a client’s
x-amz-content-sha256 header against the bytes actually received
(returning XAmzContentSHA256Mismatch on divergence) for plain,
non-aws-chunked uploads where the header carries the real payload
hash rather than a STREAMING-…/UNSIGNED-PAYLOAD marker.
md5: [u8; 16]The raw MD5 digest md5_hex spells out.
sha256: [u8; 32]The raw SHA-256 digest sha256_hex spells out.
trailers: Vec<(String, String)>Trailing headers that followed the payload: the aws-chunked trailer
section (e.g. x-amz-checksum-crc32:<base64>) and any HTTP/1.1 chunked
trailers. Names are lowercased, values trimmed; the trailer signature
line of a signed streaming upload is not included.