pub struct UpdateInfoAndProgress { /* private fields */ }
Expand description
An UpdateInfo and Progress that are guaranteed to be consistent with each other.
Specifically, progress.bytes_downloaded <= info.download_size
.
Implementations§
Source§impl UpdateInfoAndProgress
impl UpdateInfoAndProgress
Sourcepub fn builder() -> UpdateInfoAndProgressBuilder
pub fn builder() -> UpdateInfoAndProgressBuilder
Starts building an instance of UpdateInfoAndProgress.
Sourcepub fn new(
info: UpdateInfo,
progress: Progress,
) -> Result<Self, BytesFetchedExceedsDownloadSize>
pub fn new( info: UpdateInfo, progress: Progress, ) -> Result<Self, BytesFetchedExceedsDownloadSize>
Constructs an UpdateInfoAndProgress from the 2 fields, ensuring that the 2 structs are consistent with each other, returning an error if they are not.
Sourcepub fn done(info: UpdateInfo) -> Self
pub fn done(info: UpdateInfo) -> Self
Constructs an UpdateInfoAndProgress from an UpdateInfo, setting the progress fields to be 100% done with all bytes downloaded.
Sourcepub fn info(&self) -> UpdateInfo
pub fn info(&self) -> UpdateInfo
Returns the info field.
Sourcepub fn with_stage_reason(self, reason: StageFailureReason) -> FailStageData
pub fn with_stage_reason(self, reason: StageFailureReason) -> FailStageData
Constructs a FailStageData with the given reason.
Sourcepub fn with_fetch_reason(self, reason: FetchFailureReason) -> FailFetchData
pub fn with_fetch_reason(self, reason: FetchFailureReason) -> FailFetchData
Constructs a FailFetchData with the given reason.
Trait Implementations§
Source§impl Arbitrary for UpdateInfoAndProgress
impl Arbitrary for UpdateInfoAndProgress
Source§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.Source§type Strategy = BoxedStrategy<UpdateInfoAndProgress>
type Strategy = BoxedStrategy<UpdateInfoAndProgress>
The type of
Strategy
used to generate values of type Self
.Source§fn arbitrary_with((): Self::Parameters) -> Self::Strategy
fn arbitrary_with((): Self::Parameters) -> Self::Strategy
Source§impl Clone for UpdateInfoAndProgress
impl Clone for UpdateInfoAndProgress
Source§fn clone(&self) -> UpdateInfoAndProgress
fn clone(&self) -> UpdateInfoAndProgress
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for UpdateInfoAndProgress
impl Debug for UpdateInfoAndProgress
Source§impl<'de> Deserialize<'de> for UpdateInfoAndProgress
impl<'de> Deserialize<'de> for UpdateInfoAndProgress
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for UpdateInfoAndProgress
impl PartialEq for UpdateInfoAndProgress
Source§impl PartialOrd for UpdateInfoAndProgress
impl PartialOrd for UpdateInfoAndProgress
Source§impl Serialize for UpdateInfoAndProgress
impl Serialize for UpdateInfoAndProgress
impl Copy for UpdateInfoAndProgress
impl StructuralPartialEq for UpdateInfoAndProgress
Auto Trait Implementations§
impl Freeze for UpdateInfoAndProgress
impl RefUnwindSafe for UpdateInfoAndProgress
impl Send for UpdateInfoAndProgress
impl Sync for UpdateInfoAndProgress
impl Unpin for UpdateInfoAndProgress
impl UnwindSafe for UpdateInfoAndProgress
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)