[−][src]Struct s3_algo::S3Algo
Implementations
impl<S: S3 + Clone + Send + Sync + 'static> S3Algo<S>
[src]
pub fn list_prefix(
&self,
bucket: String,
prefix: String
) -> ListObjects<S, impl Stream<Item = ListObjectsV2Result> + Sized + Send>
[src]
&self,
bucket: String,
prefix: String
) -> ListObjects<S, impl Stream<Item = ListObjectsV2Result> + Sized + Send>
List all objects with a certain prefix
pub fn list_objects<F>(
&self,
bucket: String,
request_factory: F
) -> ListObjects<S, impl Stream<Item = ListObjectsV2Result> + Sized + Send> where
F: Fn() -> ListObjectsV2Request + Send + Sync + Clone,
[src]
&self,
bucket: String,
request_factory: F
) -> ListObjects<S, impl Stream<Item = ListObjectsV2Result> + Sized + Send> where
F: Fn() -> ListObjectsV2Request + Send + Sync + Clone,
List all objects given a request factory.
Paging is taken care of, so you need not fill in continuation_token
in the
ListObjectsV2Request
.
bucket
is only needed for eventual further operations on ListObjects
.
impl<S: S3 + Clone + Send + Sync + Unpin + 'static> S3Algo<S>
[src]
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() -> PutObjectRequest + Clone + Unpin + Sync + Send + 'static,
[src]
&'_ 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() -> PutObjectRequest + 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.
impl<S> S3Algo<S>
[src]
pub fn new(s3: S) -> Self
[src]
pub fn with_config(s3: S, config: Config) -> Self
[src]
Trait Implementations
Auto Trait Implementations
impl<S> RefUnwindSafe for S3Algo<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for S3Algo<S> where
S: Send,
S: Send,
impl<S> Sync for S3Algo<S> where
S: Sync,
S: Sync,
impl<S> Unpin for S3Algo<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for S3Algo<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,