pub struct SpooledBody {
pub path: PathBuf,
pub size: u64,
pub md5_hex: String,
pub sha256_hex: 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.