pub enum PlanError {
BuildClient(Error),
Prefetch(ReqwestResponseError),
GenPath(Error),
Resume(StateError),
}Expand description
Why a download plan could not be produced.
Every variant is fatal for the plan: no DownloadPlan exists, and nothing
has been written to disk. PlanError::emit maps each one onto the
equivalent Event for callers that consume the event stream rather than
the return value.
Variants§
BuildClient(Error)
The HTTP client could not be built (TLS / backend initialization, etc.).
Prefetch(ReqwestResponseError)
Prefetch exhausted its retry budget; this is the failure of the last
attempt. Earlier attempts were reported as Event::PrefetchError.
GenPath(Error)
The output path could not be computed (unwritable directory, a file name that is invalid on this platform, etc.).
Resume(StateError)
An explicit plan_resume could not continue the interrupted download.
Implementations§
Source§impl PlanError
impl PlanError
Sourcepub fn emit(self, tx: &Tx)
pub fn emit(self, tx: &Tx)
Forward this error to the event channel as the matching *Error event.
Used by the one-shot crate::download / crate::resume wrappers,
whose callers only observe the event stream.
Trait Implementations§
Source§impl Error for PlanError
impl Error for PlanError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()