pub trait UploadStreamExt: Stream {
// Provided methods
fn collect_upload<U>(self, upload: U) -> CollectUpload<Self, U>
where Self: Sized,
U: MultipartWrite<Self::Item> { ... }
fn try_upload<U, R>(
self,
upload: U,
) -> TryUploadWhen<Self, U, fn(R) -> bool>
where Self: Sized,
U: FusedMultipartWrite<Self::Item, Recv = R>,
R: ShouldComplete { ... }
fn try_upload_when<U, F>(
self,
uploader: U,
f: F,
) -> TryUploadWhen<Self, U, F>
where Self: Sized,
U: FusedMultipartWrite<Self::Item>,
F: FnMut(U::Recv) -> bool { ... }
}Expand description
Extension of Stream by methods for uploading it.
Provided Methods§
Sourcefn collect_upload<U>(self, upload: U) -> CollectUpload<Self, U>
fn collect_upload<U>(self, upload: U) -> CollectUpload<Self, U>
Future that writes a stream in parts to an upload U, completing the
upload when the stream is exhausted.
Sourcefn try_upload<U, R>(self, upload: U) -> TryUploadWhen<Self, U, fn(R) -> bool>
fn try_upload<U, R>(self, upload: U) -> TryUploadWhen<Self, U, fn(R) -> bool>
Tranforms this stream by writing its items as parts to an upload U
with return value UploadStatus.
The resulting stream produces an item from the result of completing U
when the status indicates the upload has reached the target size.
Sourcefn try_upload_when<U, F>(self, uploader: U, f: F) -> TryUploadWhen<Self, U, F>
fn try_upload_when<U, F>(self, uploader: U, f: F) -> TryUploadWhen<Self, U, F>
Tranforms this stream by writing its items as parts to an upload U.
Like try_upload except the predicate F is not
prescribed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".