pub async fn create(
        name: &str,
        region: Region,
        credentials: Credentials,
        mut config: BucketConfiguration,
    ) -> Result<CreateBucketResponse> {
        config.set_region(region.clone());
        let command = Command::CreateBucket { config };
        let bucket = Bucket::new(name, region, credentials)?;
        let request = Request::new(&bucket, "", command);
        let (data, response_code) = request.response_data_future(false).await?;
        let response_text = std::str::from_utf8(&data)?;
        Ok(CreateBucketResponse {
            bucket,
            response_text: response_text.to_string(),
            response_code,
        })
    }
/// Create a new `Bucket` and instantiate it
///
/// # Example
/// ```rust,no_run
/// use s3::{Bucket, BucketConfiguration};
/// use s3::creds::Credentials;
/// use s3::S3Error;
///
/// #[tokio::main]
/// async fn main() -> Result<(), S3Error> {
///     let bucket_name = "rust-s3-test";
///     let region = "us-east-1".parse().unwrap();
///     let credentials = Credentials::default().unwrap();
///     let config = BucketConfiguration::default();
///
///     let create_bucket_response = Bucket::create(bucket_name, region, credentials, config).await.unwrap();
///     Ok(())
/// }
/// ```
Create a new `Bucket` and instantiate it
Create a new ` Bucket ` and instantiate it
pub async fn create(
        name: &str,
        region: Region,
        credentials: Credentials,
        mut config: BucketConfiguration,
    ) -> Result<CreateBucketResponse> {
        config.set_region(region.clone());
        let command = Command::CreateBucket { config };
        let bucket = Bucket::new(name, region, credentials)?;
        let request = Request::new(&bucket, "", command);
        let (data, response_code) = request.response_data_future(false).await?;
        let response_text = std::str::from_utf8(&data)?;
        Ok(CreateBucketResponse {
            bucket,
            response_text: response_text.to_string(),
            response_code,
        })
    }
pub async fn create ( name : & str , region : Region , credentials : Credentials , mut config : BucketConfiguration , ) -> Result < CreateBucketResponse > { config . set_region ( region . clone ( ) ) ; let command = Command :: CreateBucket { config } ; let bucket = Bucket :: new ( name , region , credentials ) ? ; let request = Request :: new ( & bucket , " " , command ) ; let ( data , response_code ) = request . response_data_future ( false ) . await ? ; let response_text = std :: str :: from_utf8 ( & data ) ? ; Ok ( CreateBucketResponse { bucket , response_text : response_text . to_string ( ) , response_code , } ) }
Create a new `Bucket` and instantiate it
Create a new ` Bucket ` and instantiate it
name
&str
region
Region
credentials
Credentials
config
BucketConfiguration
name
&str
region
Region
credentials
Credentials
config
BucketConfiguration
example
```rust,no_run
use s3::{Bucket, BucketConfiguration};
use s3::creds::Credentials;
use s3::S3Error.
` ` ` rust no_run use s3 :: { Bucket BucketConfiguration } ; use s3 :: creds :: Credentials ; use s3 :: S3Error .
[tokio::main]
async fn main() -> Result<(), S3Error> {
let bucket_name = "rust-s3-test";
let region = "us-east-1".parse().unwrap();
let credentials = Credentials::default().unwrap();
let config = BucketConfiguration::default().

let create_bucket_response = Bucket::create(bucket_name, region, credentials, config).await.unwrap();
Ok(())
}
```
async fn main () - > Result< () S3Error > { let bucket_name = " rust - s3 - test " ; let region = " us - east - 1 " . parse () . unwrap () ; let credentials = Credentials :: default () . unwrap () ; let config = BucketConfiguration :: default () . let create_bucket_response = Bucket :: create ( bucket_name region credentials config ) . await . unwrap () ; Ok (( )) } ` ` `