pub async fn get_object_text(
client: &Client,
bucket: &str,
key: &str,
max_bytes: u64,
) -> Result<TextPayload, AppError>Expand description
Fetch the first max_bytes bytes of bucket/key as a UTF-8 string.
Uses a Range: bytes=0-<max_bytes-1> request so the backend never
buffers more bytes than needed for the preview.
ยงErrors
AppError::AccessDeniedโs3:GetObjectpermission denied.AppError::NotFoundโ bucket or key does not exist.AppError::Networkโ any other SDK or transport error.