pub struct S3Client<'a> { /* private fields */ }Expand description
Client for the Amazon S3 API
Implementations§
Source§impl<'a> S3Client<'a>
impl<'a> S3Client<'a>
Sourcepub async fn put_bucket_policy(&self, bucket: &str, body: &str) -> Result<()>
pub async fn put_bucket_policy(&self, bucket: &str, body: &str) -> Result<()>
Applies an Amazon S3 bucket policy to an Amazon S3 bucket.
Sourcepub async fn delete_bucket_policy(&self, bucket: &str) -> Result<()>
pub async fn delete_bucket_policy(&self, bucket: &str) -> Result<()>
Deletes the policy of a specified bucket.
Sourcepub async fn put_public_access_block(
&self,
bucket: &str,
body: &PublicAccessBlockConfiguration,
) -> Result<()>
pub async fn put_public_access_block( &self, bucket: &str, body: &PublicAccessBlockConfiguration, ) -> Result<()>
Creates or modifies the PublicAccessBlock configuration for an Amazon S3 bucket.
Sourcepub async fn list_buckets(&self) -> Result<ListBucketsResponse>
pub async fn list_buckets(&self) -> Result<ListBucketsResponse>
Returns a list of all buckets owned by the authenticated sender of the request.
Sourcepub async fn get_bucket_versioning(
&self,
bucket: &str,
) -> Result<GetBucketVersioningResponse>
pub async fn get_bucket_versioning( &self, bucket: &str, ) -> Result<GetBucketVersioningResponse>
Returns the versioning state of a bucket.
Sourcepub async fn get_bucket_encryption(
&self,
bucket: &str,
) -> Result<ServerSideEncryptionConfiguration>
pub async fn get_bucket_encryption( &self, bucket: &str, ) -> Result<ServerSideEncryptionConfiguration>
Returns the default encryption configuration for an Amazon S3 bucket.
Sourcepub async fn get_bucket_logging(
&self,
bucket: &str,
) -> Result<GetBucketLoggingResponse>
pub async fn get_bucket_logging( &self, bucket: &str, ) -> Result<GetBucketLoggingResponse>
Returns the logging status of a bucket.
Sourcepub async fn get_bucket_acl(&self, bucket: &str) -> Result<GetBucketAclResponse>
pub async fn get_bucket_acl(&self, bucket: &str) -> Result<GetBucketAclResponse>
Returns the access control list (ACL) of a bucket.
Sourcepub async fn get_bucket_lifecycle_configuration(
&self,
bucket: &str,
) -> Result<GetBucketLifecycleConfigurationResponse>
pub async fn get_bucket_lifecycle_configuration( &self, bucket: &str, ) -> Result<GetBucketLifecycleConfigurationResponse>
Returns the lifecycle configuration information set on the bucket.
Sourcepub async fn get_public_access_block(
&self,
bucket: &str,
) -> Result<PublicAccessBlockConfiguration>
pub async fn get_public_access_block( &self, bucket: &str, ) -> Result<PublicAccessBlockConfiguration>
Retrieves the PublicAccessBlock configuration for an Amazon S3 bucket.
Sourcepub async fn get_bucket_policy(&self, bucket: &str) -> Result<PolicyDocument>
pub async fn get_bucket_policy(&self, bucket: &str) -> Result<PolicyDocument>
Returns the bucket policy as a parsed PolicyDocument.
This operation is implemented manually because S3 returns the policy as a raw JSON
payload (not XML). The JSON is deserialized into a typed PolicyDocument so callers
receive structured statements rather than a raw string to re-parse.
Sourcepub async fn put_bucket_versioning(
&self,
bucket: &str,
body: &VersioningConfiguration,
) -> Result<()>
pub async fn put_bucket_versioning( &self, bucket: &str, body: &VersioningConfiguration, ) -> Result<()>
Sets the versioning state of an existing bucket.
Sourcepub async fn put_bucket_encryption(
&self,
bucket: &str,
body: &ServerSideEncryptionConfiguration,
) -> Result<()>
pub async fn put_bucket_encryption( &self, bucket: &str, body: &ServerSideEncryptionConfiguration, ) -> Result<()>
Creates the default encryption configuration for an Amazon S3 bucket.
Sourcepub async fn put_bucket_logging(
&self,
bucket: &str,
body: &BucketLoggingStatus,
) -> Result<()>
pub async fn put_bucket_logging( &self, bucket: &str, body: &BucketLoggingStatus, ) -> Result<()>
Set the logging parameters for a bucket.
Sourcepub async fn delete_bucket_lifecycle_configuration(
&self,
bucket: &str,
) -> Result<()>
pub async fn delete_bucket_lifecycle_configuration( &self, bucket: &str, ) -> Result<()>
Deletes the lifecycle configuration from the specified bucket.
Returns 204 even if no lifecycle configuration exists (idempotent).
Sourcepub async fn put_bucket_lifecycle_configuration(
&self,
bucket: &str,
body: &BucketLifecycleConfiguration,
) -> Result<()>
pub async fn put_bucket_lifecycle_configuration( &self, bucket: &str, body: &BucketLifecycleConfiguration, ) -> Result<()>
Creates a new lifecycle configuration for the bucket or replaces an existing lifecycle configuration.
Uses hand-built XML because S3 expects <LifecycleConfiguration> root with
<Rule> elements (not <BucketLifecycleConfiguration> / <Rules>).