Function iroh_blobs::get::db::get_to_db_in_steps

source ·
pub async fn get_to_db_in_steps<D: BaoStore, P: ProgressSender<Msg = DownloadProgress> + IdGenerator>(
    db: D,
    hash_and_format: HashAndFormat,
    progress_sender: P
) -> Result<GetState, GetError>
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 GetState, 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 GetStateNeedsConn::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.