Struct s3_sync::S3

source · []
pub struct S3 { /* private fields */ }
Expand description

Wrapper of Rusoto S3 client that adds some high level imperative and declarative operations on S3 buckets and objects.

Implementations

Creates new Rusoto based high level S3 client with default settings.

Creates new Rusoto based high level S3 client with given settings.

Gets maximum size of the multipart upload part.

Useful to set up other I/O buffers accordingly.

Returns maximum size of data in bytes that S3 object can be put with.

Set callback on body upload progress.

Calls f with S3 client that has on_upload_progress set to callback and restores callback to previous state on return.

Checks if given bucket exists.

Checks if given object exists.

  • implementaiton - select implementation of ths function

Checks if given object exists by issuing HeadObject request.

Requires GetObject premission.

Checks if given object exists by listing objects.

Requires ListBucket permission.

Provides iterator of objects in existing bucket that have key of given prefix.

Gets object body.

Puts object with given body using multipart API.

If given existing object it will be overwritten.

Use .max_upload_size() to find out how many bytes the body can have at maximum. Increase part_size to be able to upload more date (max_upload_size = part_number * 10_000).

Deletes single object.

Delete call does not fail if object does not exist and therefore this method can work with Present, Absent or just Object values.

To delete many objects it is better performance wise to use .delete_objects() witch uses bulk delete API.

Deletes list of objects in streaming fashion using bulk delete API.

Note that if returned iterator is not completely consumed not all items from the list may be processed.

Delete call does not fail if object does not exist and therefore this method can work with Present, Absent or just Object values.

Objects can live in different buckets but for best performance it is recommended to order the list by bucket so that biggest batches can be crated.

Each returned item represent batch delete call to S3 API. Successful batch call will return Ok variant containing vector of results for each individual object delete operation as provided by S3.

Returns Ensure object that can be used to ensure that object is present in the S3 bucket.

It will call body function to obtain Read object from which the data will be uploaded to S3 and its meta data if object does not already exist there.

Note that there can be a race condition between check if object exists and upload.

Returns Ensure object that can be used to ensure that object is absent in the S3 bucket.

Note that there can be a race condition between check if object exists and delete operation.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

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.