pub enum AddProgressItem {
CopyProgress(u64),
Size(u64),
CopyDone,
OutboardProgress(u64),
Done(TempTag),
Error(Error),
}
Expand description
Progress events for importing from any local source.
For sources with known size such as blobs or files, you will get the events in the following order:
Size -> CopyProgress(*n) -> CopyDone -> OutboardProgress(*n) -> Done
For sources with unknown size such as streams, you will get the events in the following order:
CopyProgress(*n) -> Size -> CopyDone -> OutboardProgress(*n) -> Done
Errors can happen at any time, and will be reported as an Error
event.
Variants§
CopyProgress(u64)
Progress copying the file into the data directory.
On most modern systems, copying will be done with copy on write, so copying will be instantaneous and you won’t get any of these.
The number is the byte offset of the copy process.
This is an ephemeral progress event, so you can’t rely on getting regular updates.
Size(u64)
Size of the file or stream has been determined.
For some input such as blobs or files, the size is immediately known. For other inputs such as streams, the size is determined by reading the stream to the end.
This is a guaranteed progress event, so you can rely on getting exactly one of these.
CopyDone
The copy part of the import operation is done.
This is a guaranteed progress event, so you can rely on getting exactly one of these.
OutboardProgress(u64)
Progress computing the outboard and root hash of the imported data.
This is an ephemeral progress event, so you can’t rely on getting regular updates.
Done(TempTag)
The import is done. Once you get this event the data is available and protected in the store via the temp tag.
This is a guaranteed progress event, so you can rely on getting exactly one of these if the operation was successful.
This is one of the two possible final events. After this event, there won’t be any more progress events.
Error(Error)
The import failed with an error. Partial data will be deleted.
This is a guaranteed progress event, so you can rely on getting exactly one of these if the operation was unsuccessful.
This is one of the two possible final events. After this event, there won’t be any more progress events.