Trait iroh_blobs::downloader::Getter

source ·
pub trait Getter {
    type Connection: 'static;
    type NeedsConn: NeedsConn<Self::Connection>;

    // Required method
    fn get(
        &mut self,
        kind: DownloadKind,
        progress_sender: BroadcastProgressSender
    ) -> BoxedLocal<Result<GetOutput<Self::NeedsConn>, FailureAction>>;
}
Available on crate feature downloader only.
Expand description

Trait modelling performing a single request over a connection. This allows for IO-less testing.

Required Associated Types§

source

type Connection: 'static

Type of connections the Getter requires to perform a download.

source

type NeedsConn: NeedsConn<Self::Connection>

Type of the intermediary state returned from Self::get if a connection is needed.

Required Methods§

source

fn get( &mut self, kind: DownloadKind, progress_sender: BroadcastProgressSender ) -> BoxedLocal<Result<GetOutput<Self::NeedsConn>, FailureAction>>

Returns a future that checks the local store if the request is already complete, returning a struct implementing NeedsConn if we need a network connection to proceed.

Object Safety§

This trait is not object safe.

Implementors§