pub struct S3Client { /* private fields */ }Expand description
An async S3-compatible client.
Implementations§
Source§impl S3Client
impl S3Client
Sourcepub async fn create_multipart_upload(
&self,
request: CreateMultipartUploadRequest,
) -> Result<CreateMultipartUploadOutput, S3Error>
pub async fn create_multipart_upload( &self, request: CreateMultipartUploadRequest, ) -> Result<CreateMultipartUploadOutput, S3Error>
Initiates a multipart upload for an object.
§Errors
Returns an error for invalid headers, transport or service failures, or a malformed or oversized service response.
Sourcepub async fn upload_part(
&self,
request: UploadPartRequest<ByteStream>,
) -> Result<UploadPartOutput, S3Error>
pub async fn upload_part( &self, request: UploadPartRequest<ByteStream>, ) -> Result<UploadPartOutput, S3Error>
Uploads one part of an in-progress multipart upload.
§Errors
Returns an error for an invalid checksum, body preparation failure, transport or service failure, or malformed response headers.
Sourcepub async fn complete_multipart_upload(
&self,
request: CompleteMultipartUploadRequest,
) -> Result<CompleteMultipartUploadOutput, S3Error>
pub async fn complete_multipart_upload( &self, request: CompleteMultipartUploadRequest, ) -> Result<CompleteMultipartUploadOutput, S3Error>
Completes an in-progress multipart upload.
§Errors
Returns an error when the completion document cannot be serialized, the request fails, or S3 returns a malformed, oversized, or embedded error.
Sourcepub async fn abort_multipart_upload(
&self,
request: AbortMultipartUploadRequest,
) -> Result<RequestIds, S3Error>
pub async fn abort_multipart_upload( &self, request: AbortMultipartUploadRequest, ) -> Result<RequestIds, S3Error>
Aborts an in-progress multipart upload.
§Errors
Returns an error when target construction, signing, transport, or the S3 service rejects the abort request.
Sourcepub async fn list_multipart_uploads(
&self,
request: ListMultipartUploadsRequest,
) -> Result<ListMultipartUploadsOutput, S3Error>
pub async fn list_multipart_uploads( &self, request: ListMultipartUploadsRequest, ) -> Result<ListMultipartUploadsOutput, S3Error>
Retrieves one bounded page of in-progress multipart uploads.
§Errors
Returns an error for inconsistent pagination markers, a failed request, or a malformed or oversized listing response.
Source§impl S3Client
impl S3Client
Sourcepub async fn multipart_upload(
&self,
request: ManagedMultipartUploadRequest,
) -> Result<CompleteMultipartUploadOutput, S3Error>
pub async fn multipart_upload( &self, request: ManagedMultipartUploadRequest, ) -> Result<CompleteMultipartUploadOutput, S3Error>
Uploads a replayable bytes or file source using bounded multipart requests.
Part size, concurrency, and total in-flight part bytes are taken from the
client configuration. File input is snapshotted before an upload is
created. Dropping this future cancels outstanding parts and leaves an
owned cleanup task to abort the upload. A normal failure waits for abort;
if abort also fails, S3Error::cleanup_failure exposes that error while
preserving the original failure.
§Errors
Returns an error if the source cannot be prepared, exceeds S3’s 10,000 part limit, a part fails, cancellation occurs, completion fails, or abort cleanup fails after another error.
Source§impl S3Client
impl S3Client
Sourcepub async fn list_objects_v2(
&self,
request: ListObjectsV2Request,
) -> Result<ListObjectsV2Output, S3Error>
pub async fn list_objects_v2( &self, request: ListObjectsV2Request, ) -> Result<ListObjectsV2Output, S3Error>
Retrieves one page from S3’s version-two object listing API.
§Errors
Returns an error when signing, transport, or response parsing fails.
Sourcepub async fn list_objects_v2_all(
&self,
request: ListObjectsV2Request,
maximum_pages: usize,
) -> Result<Vec<ListObjectsV2Output>, S3Error>
pub async fn list_objects_v2_all( &self, request: ListObjectsV2Request, maximum_pages: usize, ) -> Result<Vec<ListObjectsV2Output>, S3Error>
Retrieves at most maximum_pages, rejecting missing or repeating page tokens.
§Errors
Returns an error for a zero page bound, a malformed pagination sequence, an exhausted page bound, or any page request failure.
Source§impl S3Client
impl S3Client
Sourcepub async fn put_object(
&self,
request: PutObjectRequest<ByteStream>,
) -> Result<PutObjectOutput, S3Error>
pub async fn put_object( &self, request: PutObjectRequest<ByteStream>, ) -> Result<PutObjectOutput, S3Error>
Uploads one object to the configured bucket.
§Errors
Returns an error when request preparation, signing, transport, or response parsing fails.
Sourcepub async fn get_object(
&self,
request: GetObjectRequest,
) -> Result<GetObjectOutput<ResponseStream>, S3Error>
pub async fn get_object( &self, request: GetObjectRequest, ) -> Result<GetObjectOutput<ResponseStream>, S3Error>
Downloads one object as a bounded, cancellation-safe response stream.
§Errors
Returns an error when request validation, signing, transport, or header parsing fails.
Sourcepub async fn head_object(
&self,
request: HeadObjectRequest,
) -> Result<HeadObjectOutput, S3Error>
pub async fn head_object( &self, request: HeadObjectRequest, ) -> Result<HeadObjectOutput, S3Error>
Retrieves one object’s metadata without downloading its body.
§Errors
Returns an error when signing, transport, or response parsing fails.
Sourcepub async fn delete_object(
&self,
request: DeleteObjectRequest,
) -> Result<DeleteObjectOutput, S3Error>
pub async fn delete_object( &self, request: DeleteObjectRequest, ) -> Result<DeleteObjectOutput, S3Error>
Deletes one object or object version.
§Errors
Returns an error when signing, transport, or response parsing fails.
Sourcepub async fn delete_objects(
&self,
request: DeleteObjectsRequest,
) -> Result<DeleteObjectsOutput, S3Error>
pub async fn delete_objects( &self, request: DeleteObjectsRequest, ) -> Result<DeleteObjectsOutput, S3Error>
Deletes a validated batch of objects in one request.
§Errors
Returns an error when XML serialization, signing, transport, or response parsing fails.
Sourcepub async fn copy_object(
&self,
request: CopyObjectRequest,
) -> Result<CopyObjectOutput, S3Error>
pub async fn copy_object( &self, request: CopyObjectRequest, ) -> Result<CopyObjectOutput, S3Error>
Copies an object entirely within S3.
§Errors
Returns an error when request validation, signing, transport, or response parsing fails.
Source§impl S3Client
impl S3Client
Sourcepub async fn presigned_get(
&self,
key: &ObjectKey,
expires: Duration,
) -> Result<PresignedUrl, S3Error>
pub async fn presigned_get( &self, key: &ObjectKey, expires: Duration, ) -> Result<PresignedUrl, S3Error>
Generates a presigned GET URL whose standard formatting is redacted.
Sourcepub async fn presigned_put(
&self,
key: &ObjectKey,
expires: Duration,
) -> Result<PresignedUrl, S3Error>
pub async fn presigned_put( &self, key: &ObjectKey, expires: Duration, ) -> Result<PresignedUrl, S3Error>
Generates a presigned PUT URL whose standard formatting is redacted.