Trait StreamingSource

Source
pub trait StreamingSource {
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn next(
        &mut self,
    ) -> impl Future<Output = Option<Result<Bytes, Self::Error>>> + Send;

    // Provided method
    fn size_hint(&self) -> (u64, Option<u64>) { ... }
}
Expand description

Provides bytes for an upload from single-pass sources.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The error type.

Required Methods§

Source

fn next( &mut self, ) -> impl Future<Output = Option<Result<Bytes, Self::Error>>> + Send

Gets the next set of data to upload.

Provided Methods§

Source

fn size_hint(&self) -> (u64, Option<u64>)

An estimate of the upload size.

Returns the expected size as a [min, max) range. Where None represents an unknown limit for the upload.

If the upper limit is known and sufficiently small, the client library may be able to use a more efficient protocol for the upload.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§