pub enum NetError {
Reqwest(Arc<Error>),
Redirect(Arc<Error>),
Io(Arc<Error>),
Cancelled(String),
Read(Arc<Error>),
Other(Arc<Error>),
Timeout(String),
}Expand description
Network-level errors.
Variants§
Reqwest(Arc<Error>)
Error reported by the underlying HTTP client
Redirect(Arc<Error>)
Redirect could not be followed (e.g. too many redirects, invalid target)
Io(Arc<Error>)
I/O error while transferring data
Cancelled(String)
Request was cancelled before it completed; the string describes why
Read(Arc<Error>)
Error while reading the response body
Other(Arc<Error>)
Any other error not covered by the variants above
Timeout(String)
Request did not complete within the configured time limit
Implementations§
Source§impl NetError
impl NetError
Sourcepub fn to_io(&self) -> Error
pub fn to_io(&self) -> Error
Wrap this error in an io::Error, carrying the typed error as the source so the other
side of an AsyncRead boundary can recover the original NetError (see
stream_to_bytes) instead of a stringified copy.
Sourcepub fn from_anyhow(e: Error) -> Self
pub fn from_anyhow(e: Error) -> Self
Wraps an anyhow::Error as a NetError::Read
Trait Implementations§
Source§impl Error for NetError
impl Error for NetError
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 !RefUnwindSafe for NetError
impl !UnwindSafe for NetError
impl Freeze for NetError
impl Send for NetError
impl Sync for NetError
impl Unpin for NetError
impl UnsafeUnpin for NetError
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