pub struct HistoryEntry {
pub id: String,
pub url: String,
pub filename: String,
pub output_dir: String,
pub status: EntryStatus,
pub bytes_total: Option<u64>,
pub sha256: Option<String>,
pub expected_sha256: Option<String>,
pub created_at: u64,
pub finished_at: Option<u64>,
pub error: Option<String>,
}Expand description
A single record in the download history.
Fields§
§id: StringShort hex identifier derived from the URL and creation time.
url: StringSource URL or magnet link.
filename: StringFilename extracted from the URL or Content-Disposition.
output_dir: StringDirectory where the file was (or would be) saved.
status: EntryStatusFinal outcome.
bytes_total: Option<u64>File size in bytes, if known after the download.
sha256: Option<String>SHA-256 of the completed file, if computed.
expected_sha256: Option<String>Expected SHA-256 supplied by the user, if any.
created_at: u64Unix timestamp (seconds UTC) when the download was enqueued.
finished_at: Option<u64>Unix timestamp (seconds UTC) when the download finished.
error: Option<String>Error message for failed downloads.
Implementations§
Source§impl HistoryEntry
impl HistoryEntry
Sourcepub fn new(url: &str, output_dir: &str, expected_sha256: Option<&str>) -> Self
pub fn new(url: &str, output_dir: &str, expected_sha256: Option<&str>) -> Self
Create a new pending entry. Call DownloadHistory::record to
finalise it with a status and optional error once the download is done.
Sourcepub fn created_at_display(&self) -> String
pub fn created_at_display(&self) -> String
Human-readable UTC string for created_at (e.g. 2026-05-21 14:32 UTC).
Sourcepub fn finished_at_display(&self) -> Option<String>
pub fn finished_at_display(&self) -> Option<String>
Human-readable UTC string for finished_at, if set.
Trait Implementations§
Source§impl Clone for HistoryEntry
impl Clone for HistoryEntry
Source§fn clone(&self) -> HistoryEntry
fn clone(&self) -> HistoryEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HistoryEntry
impl Debug for HistoryEntry
Source§impl<'de> Deserialize<'de> for HistoryEntry
impl<'de> Deserialize<'de> for HistoryEntry
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>,
Auto Trait Implementations§
impl Freeze for HistoryEntry
impl RefUnwindSafe for HistoryEntry
impl Send for HistoryEntry
impl Sync for HistoryEntry
impl Unpin for HistoryEntry
impl UnsafeUnpin for HistoryEntry
impl UnwindSafe for HistoryEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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