iroh_blobs::store

Function get_to_db

Source
pub async fn get_to_db<D: BaoStore, C: FnOnce() -> F, F: Future<Output = Result<Connection>>>(
    db: &D,
    get_conn: C,
    hash_and_format: &HashAndFormat,
    progress_sender: impl ProgressSender<Msg = DownloadProgressEvent> + IdGenerator,
) -> Result<Stats, Error>
Expand description

Get a blob or collection into a store.

This considers data that is already in the store, and will only request the remaining data.

Progress is reported as DownloadProgressEvent through a ProgressSender. Note that the DownloadProgressEvent::AllDone event is not emitted from here, but left to an upper layer to send, if desired.