Function iroh_blobs::provider::transfer_collection

source ยท
pub async fn transfer_collection<D: Map, E: EventSender>(
    request: GetRequest,
    db: &D,
    writer: &mut ResponseWriter<E>,
    outboard: impl Outboard,
    data: impl AsyncSliceReader,
    stats: &mut TransferStats
) -> Result<SentStatus>
Expand description

Transfers the collection & blob data.

First, it transfers the collection data & its associated outboard encoding data. Then it sequentially transfers each individual blob data & its associated outboard encoding data.

Will fail if there is an error writing to the getter or reading from the database.

If a blob from the collection cannot be found in the database, the transfer will gracefully close the writer, and return with Ok(SentStatus::NotFound).

If the transfer does not end in error, the buffer will be empty and the writer is gracefully closed.