#[non_exhaustive]pub struct TaskResume {
pub version: u32,
pub files: BTreeMap<String, FileResume>,
}Expand description
Per-file resume checkpoints persisted alongside a task.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.version: u32Schema version of the resume manifest.
files: BTreeMap<String, FileResume>Checkpoints keyed by source URL.
Implementations§
Source§impl TaskResume
impl TaskResume
Sourcepub fn file(&self, url: &str) -> Option<&FileResume>
pub fn file(&self, url: &str) -> Option<&FileResume>
Checkpoint for url, if one exists.
Sourcepub fn upsert(&mut self, url: String, file: FileResume)
pub fn upsert(&mut self, url: String, file: FileResume)
Insert or replace the checkpoint for url.
Sourcepub fn downloaded(&self) -> u64
pub fn downloaded(&self) -> u64
Total completed bytes across all checkpointed files.
Trait Implementations§
Source§impl Clone for TaskResume
impl Clone for TaskResume
Source§impl Debug for TaskResume
impl Debug for TaskResume
Source§impl Default for TaskResume
impl Default for TaskResume
Source§impl<'de> Deserialize<'de> for TaskResume
impl<'de> Deserialize<'de> for TaskResume
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 Forget for TaskResume
impl Freeze for TaskResume
impl Move for TaskResume
impl RefUnwindSafe for TaskResume
impl Send for TaskResume
impl Sync for TaskResume
impl Unpin for TaskResume
impl UnsafeUnpin for TaskResume
impl UnwindSafe for TaskResume
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