pub enum TransferError {
Network(String),
Timeout(Duration),
Status {
status: u16,
retry_after: Option<Duration>,
},
RemoteChanged(String),
Protocol(String),
Io(String),
Cancelled,
}Variants§
Network(String)
Connection reset, DNS failure, TLS handshake failure, network down.
Timeout(Duration)
No bytes arrived within the read timeout.
Status
The server answered, unhappily.
RemoteChanged(String)
Validators say we are no longer looking at the same bytes. Retrying cannot fix this and continuing would corrupt the file.
Protocol(String)
The server broke the HTTP contract — ignored Range, returned a
Content-Range that does not match what we asked for, sent more bytes
than it promised.
Io(String)
Local disk problem.
Cancelled
Graceful shutdown, not really a failure.
Implementations§
Source§impl TransferError
impl TransferError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
PRD §14: retry connection resets, timeouts, DNS failures, 408, 429, 5xx. Nothing else.
Sourcepub fn retry_after(&self) -> Option<Duration>
pub fn retry_after(&self) -> Option<Duration>
Server-suggested delay, honoured when present (PRD §14).
pub fn from_reqwest(err: &Error) -> Self
Trait Implementations§
Source§impl Debug for TransferError
impl Debug for TransferError
Source§impl Display for TransferError
impl Display for TransferError
Source§impl Error for TransferError
impl Error for TransferError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for TransferError
impl RefUnwindSafe for TransferError
impl Send for TransferError
impl Sync for TransferError
impl Unpin for TransferError
impl UnsafeUnpin for TransferError
impl UnwindSafe for TransferError
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