Struct rusty_s3::Bucket[][src]

pub struct Bucket { /* fields omitted */ }
Expand description

An S3 bucket

Path style url

let endpoint = "https://s3.dualstack.eu-west-1.amazonaws.com".parse().expect("endpoint is a valid Url");
let path_style = UrlStyle::Path;
let name = "rusty-s3";
let region = "eu-west-1";

let bucket = Bucket::new(endpoint, path_style, name, region).expect("Url has a valid scheme and host");
assert_eq!(bucket.base_url().as_str(), "https://s3.dualstack.eu-west-1.amazonaws.com/rusty-s3/");
assert_eq!(bucket.name(), "rusty-s3");
assert_eq!(bucket.region(), "eu-west-1");
assert_eq!(bucket.object_url("duck.jpg").expect("url is valid").as_str(), "https://s3.dualstack.eu-west-1.amazonaws.com/rusty-s3/duck.jpg");

Domain style url

let endpoint = "https://s3.dualstack.eu-west-1.amazonaws.com".parse().expect("endpoint is a valid Url");
let path_style = UrlStyle::VirtualHost;
let name = "rusty-s3";
let region = "eu-west-1";

let bucket = Bucket::new(endpoint, path_style, name, region).expect("Url has a valid scheme and host");
assert_eq!(bucket.base_url().as_str(), "https://rusty-s3.s3.dualstack.eu-west-1.amazonaws.com/");
assert_eq!(bucket.name(), "rusty-s3");
assert_eq!(bucket.region(), "eu-west-1");
assert_eq!(bucket.object_url("duck.jpg").expect("url is valid").as_str(), "https://rusty-s3.s3.dualstack.eu-west-1.amazonaws.com/duck.jpg");

Implementations

Construct a new S3 bucket

Get the base url of this s3 Bucket

Get the name of this Bucket

Get the region of this Bucket

Generate an url to an object of this Bucket

This is not a signed url, it’s just the starting point for generating an url to an S3 object.

Create a new bucket.

See CreateBucket for more details.

Delete a bucket.

See DeleteBucket for more details.

Retrieve an object’s metadata from S3, using a HEAD request.

See HeadObject for more details.

Retrieve an object from S3, using a GET request.

See GetObject for more details.

List all objects in the bucket.

See ListObjectsV2 for more details.

Upload a file to S3, using a PUT request.

See PutObject for more details.

Delete an object from S3, using a DELETE request.

See DeleteObject for more details.

Delete multiple objects from S3 using a single POST request.

See DeleteObjects for more details.

Create a multipart upload.

See CreateMultipartUpload for more details.

Upload a part to a previously created multipart upload.

See UploadPart for more details.

Complete a multipart upload.

See CompleteMultipartUpload for more details.

Abort multipart upload.

See AbortMultipartUpload for more details.

Lists the parts that have been uploaded for a specific multipart upload.

See ListParts for more details.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.