pub async fn get_object_bytes(
client: &Client,
bucket: &str,
key: &str,
max_bytes: u64,
) -> Result<BytesPayload, AppError>Expand description
Fetch the first max_bytes bytes of bucket/key as base64-encoded binary.
Uses a Range: bytes=0-<max_bytes-1> request so large objects are not
fully downloaded. Returns a BytesPayload with the base64-encoded body,
total content length, ETag, and a truncated flag.
ยงErrors
AppError::AccessDeniedโs3:GetObjectpermission denied.AppError::NotFoundโ bucket or key does not exist.AppError::Networkโ any other SDK or transport error.