struct TransferProgress {
resumed_from: HashMap<String, u64>,
in_flight: HashMap<String, (u64, u64)>,
cancelling: Option<String>,
}Expand description
Per-file transfer bookkeeping, kept across the progress events of one
prepare call.
Keyed by file throughout because the models are prepared concurrently
and their events interleave: a single slot lets one model’s
Verifying clear the other’s resume marker mid-transfer, and lets a
model that already finished be named as the one a cancellation
stopped.
Fields§
§resumed_from: HashMap<String, u64>What a .part held when its transfer opened. A bar that starts
at 38% with nothing said about it reads as a bug.
in_flight: HashMap<String, (u64, u64)>Bytes seen so far per file still transferring.
cancelling: Option<String>Which transfer a cancellation is reported against. With one model in flight this names the same file the old single slot did.
Implementations§
Source§impl TransferProgress
impl TransferProgress
Sourcefn apply(&mut self, progress: Progress) -> (String, DictateModelState)
fn apply(&mut self, progress: Progress) -> (String, DictateModelState)
Fold one event in and return the row state it implies.
Sourcefn cancellation(&self) -> (String, u64, u64)
fn cancellation(&self) -> (String, u64, u64)
The file a cancellation is about and how far it got. An empty name when nothing was transferring, which names no row and shows no bytes rather than blaming a model that finished.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TransferProgress
impl RefUnwindSafe for TransferProgress
impl Send for TransferProgress
impl Sync for TransferProgress
impl Unpin for TransferProgress
impl UnsafeUnpin for TransferProgress
impl UnwindSafe for TransferProgress
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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