pub struct FailedDownload {
pub id: String,
pub display_name: String,
pub error: String,
pub failed_at: u64,
pub recoverable: bool,
pub downloaded_bytes: u64,
}Expand description
A failed download kept for display purposes.
Fields§
§id: StringCanonical ID of the failed download.
display_name: StringDisplay name.
error: StringError message.
failed_at: u64Timestamp when the failure occurred (Unix epoch seconds).
recoverable: boolWhether the failure is recoverable (can retry).
downloaded_bytes: u64Bytes downloaded before failure.
Implementations§
Source§impl FailedDownload
impl FailedDownload
Sourcepub fn new(
id: impl Into<String>,
display_name: impl Into<String>,
error: impl Into<String>,
failed_at: u64,
) -> Self
pub fn new( id: impl Into<String>, display_name: impl Into<String>, error: impl Into<String>, failed_at: u64, ) -> Self
Create a new failed download record.
Sourcepub const fn with_recoverable(self, recoverable: bool) -> Self
pub const fn with_recoverable(self, recoverable: bool) -> Self
Mark as recoverable.
Sourcepub const fn with_downloaded_bytes(self, bytes: u64) -> Self
pub const fn with_downloaded_bytes(self, bytes: u64) -> Self
Set bytes downloaded before failure.
Trait Implementations§
Source§impl Clone for FailedDownload
impl Clone for FailedDownload
Source§fn clone(&self) -> FailedDownload
fn clone(&self) -> FailedDownload
Returns a duplicate 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 FailedDownload
impl Debug for FailedDownload
Source§impl<'de> Deserialize<'de> for FailedDownload
impl<'de> Deserialize<'de> for FailedDownload
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
Auto Trait Implementations§
impl Freeze for FailedDownload
impl RefUnwindSafe for FailedDownload
impl Send for FailedDownload
impl Sync for FailedDownload
impl Unpin for FailedDownload
impl UnwindSafe for FailedDownload
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