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.
Trait Implementations§
Source§impl Debug for AddProgressItem
impl Debug for AddProgressItem
Source§impl<'de> Deserialize<'de> for AddProgressItem
impl<'de> Deserialize<'de> for AddProgressItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<Error> for AddProgressItem
impl From<Error> for AddProgressItem
Auto Trait Implementations§
impl Freeze for AddProgressItem
impl !RefUnwindSafe for AddProgressItem
impl Send for AddProgressItem
impl Sync for AddProgressItem
impl Unpin for AddProgressItem
impl UnsafeUnpin for AddProgressItem
impl !UnwindSafe for AddProgressItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more