iroh_blobs::store

Function get_to_db_in_steps

Source
pub async fn get_to_db_in_steps<D: BaoStore, P: ProgressSender<Msg = DownloadProgressEvent> + IdGenerator>(
    db: D,
    hash_and_format: HashAndFormat,
    progress_sender: P,
) -> Result<FetchState, Error>
Expand description

Get a blob or collection into a store, yielding if a connection is needed.

This checks a get request against a local store, and returns FetchState, which is either Complete in case the requested data is fully available in the local store, or NeedsConn, once a connection is needed to proceed downloading the missing data.

In the latter case, call FetchStateNeedsConn::proceed with a connection to a provider to proceed with the download.

Progress reporting works in the same way as documented in get_to_db.