pub enum FetchError {
NotFound(String),
NetworkNotImplemented,
Network(String),
Timeout {
timeout_ms: u64,
},
HttpStatus {
status: u16,
url: String,
},
UnsupportedContentType(String),
Url(UrlError),
Cache(String),
Security(SecurityError),
}Expand description
Fetch errors.
Variants§
NotFound(String)
No response is registered for the requested URL.
NetworkNotImplemented
Real network IO is unavailable for this fetcher.
Network(String)
Network IO failed.
Timeout
The network operation timed out.
HttpStatus
The server returned a non-success HTTP status.
UnsupportedContentType(String)
The response MIME type is not supported for text transformation.
Url(UrlError)
A URL returned by the transport was invalid or unsafe.
Cache(String)
Cache lookup failed while handling a network fallback.
Security(SecurityError)
A security policy rejected the response.
Implementations§
Source§impl FetchError
impl FetchError
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Returns whether retrying or falling back to cache is reasonable.
Trait Implementations§
Source§impl Clone for FetchError
impl Clone for FetchError
Source§fn clone(&self) -> FetchError
fn clone(&self) -> FetchError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FetchError
impl Debug for FetchError
Source§impl Display for FetchError
impl Display for FetchError
Source§impl Error for FetchError
impl Error for FetchError
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()
Source§impl PartialEq for FetchError
impl PartialEq for FetchError
Source§fn eq(&self, other: &FetchError) -> bool
fn eq(&self, other: &FetchError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for FetchError
impl StructuralPartialEq for FetchError
Auto Trait Implementations§
impl Freeze for FetchError
impl RefUnwindSafe for FetchError
impl Send for FetchError
impl Sync for FetchError
impl Unpin for FetchError
impl UnsafeUnpin for FetchError
impl UnwindSafe for FetchError
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