Skip to main content

UploadStreamExt

Trait UploadStreamExt 

Source
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§

Source

fn collect_upload<U>(self, upload: U) -> CollectUpload<Self, U>
where Self: Sized, U: MultipartWrite<Self::Item>,

Future that writes a stream in parts to an upload U, completing the upload when the stream is exhausted.

Source

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,

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.

Source

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,

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".

Implementors§