iroh_blobs::downloader

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

Implementors§