Struct s3_algo::S3Algo

source ·
pub struct S3Algo { /* private fields */ }

Implementations§

source§

impl S3Algo

source

pub fn list_prefix( &self, bucket: String, prefix: Option<String> ) -> ListObjects<impl Stream<Item = Result<ListObjectsV2Output, Error>> + Sized + Send>

List objects of a bucket.

source§

impl S3Algo

source

pub async fn upload_files<P, F, I, R>( &self, bucket: String, files: I, progress: P, default_request: R ) -> Result<(), Error>
where P: Fn(RequestReport) -> F + Clone + Send + Sync + 'static, F: Future<Output = ()> + Send + 'static, I: Iterator<Item = ObjectSource> + Send + 'static, R: Fn(&Client) -> PutObjectFluentBuilder + Clone + Unpin + Sync + Send + 'static,

Upload multiple files to S3.

upload_files provides counting of uploaded files and bytes through the progress closure:

For common use cases it is adviced to use files_recursive for the files parameter.

progress will be called after the upload of each file, with some data about that upload. The first usize parameter is the number of this file in the upload, while RequestReport holds more data such as size in bytes, and the duration of the upload. It is thus possible to report progress both in amount of files, or amount of bytes, depending on what granularity is desired. progress returns a generic F: Future to support async operations like, for example, logging the results to a file; this future will be run as part of the upload algorithm.

default_request constructs the default request struct - only the fields bucket, key, body and content_length are overwritten by the upload algorithm.

source§

impl S3Algo

source

pub fn new(s3: Client) -> Self

source

pub fn with_config(s3: Client, config: Config) -> Self

Trait Implementations§

source§

impl Clone for S3Algo

source§

fn clone(&self) -> S3Algo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for S3Algo

§

impl Send for S3Algo

§

impl Sync for S3Algo

§

impl Unpin for S3Algo

§

impl !UnwindSafe for S3Algo

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more