Skip to main content

Puller

Trait Puller 

Source
pub trait Puller:
    Send
    + Sync
    + Clone
    + 'static {
    type Error: PullerError;

    // Required method
    fn pull(
        &mut self,
        range: Option<&ProgressEntry>,
    ) -> impl Future<Output = PullResult<impl PullStream<Self::Error>, Self::Error>> + Send;
}
Expand description

Abstraction over a data source that can be pulled (downloaded) in chunks.

Implementors produce a PullStream of bytes, optionally restricted to a specific byte range. Cloning is required for retry and work-stealing scenarios.

Required Associated Types§

Required Methods§

Source

fn pull( &mut self, range: Option<&ProgressEntry>, ) -> impl Future<Output = PullResult<impl PullStream<Self::Error>, Self::Error>> + Send

Pull a (sub)range of the source as a stream of byte chunks.

Passing None for range requests the entire source. The returned PullStream yields Bytes chunks; each error carries an optional retry delay that the engine honors via its retry backoff. Implementors must be Clone so workers can be spawned and work can be stolen/retried.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§