pub enum DownloadState {
Waiting,
Converting {
done_percent: Option<u8>,
eta_secs: Option<u64>,
},
Writing {
done_percent: Option<u8>,
},
Ready {
size: u64,
sha256: String,
},
Failed {
reason: String,
cause: DownloadFailure,
},
Unknown,
}Expand description
Where a download is.
Variants§
Waiting
Waiting its turn: for its conversion, for room on the server, or for a place to write it.
Converting
What the device cannot play is being converted, or picture
subtitles read as text: done_percent of it, and about
eta_secs to go, once known.
Writing
The file is being written: done_percent of it, once known.
Ready
The file is whole: size bytes, with this SHA-256 (64 hex
digits). Read it with ResourceRequest::Download.
Failed
It could not be made: a conversion failed, the file is gone, or
the server removed it a day after its last read. PrepareDownload
again tries again, under the same id.
Fields
§
cause: DownloadFailureWhy, for the app to choose what to show and offer; other
from a server before it was sent.
Unknown
A state this build does not know: ask DownloadStatus later.
Trait Implementations§
Source§impl Clone for DownloadState
impl Clone for DownloadState
Source§impl Debug for DownloadState
impl Debug for DownloadState
Source§impl<'de> Deserialize<'de> for DownloadState
impl<'de> Deserialize<'de> for DownloadState
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
impl Eq for DownloadState
Source§impl PartialEq for DownloadState
impl PartialEq for DownloadState
Source§impl Serialize for DownloadState
impl Serialize for DownloadState
impl StructuralPartialEq for DownloadState
Auto Trait Implementations§
impl Freeze for DownloadState
impl RefUnwindSafe for DownloadState
impl Send for DownloadState
impl Sync for DownloadState
impl Unpin for DownloadState
impl UnsafeUnpin for DownloadState
impl UnwindSafe for DownloadState
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