#[non_exhaustive]pub enum NetError {
Show 13 variants
Unsupported(Unsupported),
InvalidUrl(String),
InvalidRequest(String),
Timeout,
Connect {
message: String,
cross_origin: bool,
},
Blocked(String),
Status(StatusCode),
Body(String),
TooLarge {
limit: usize,
},
Redirect,
Closed,
ClosedWith {
code: u32,
reason: String,
},
Protocol(String),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unsupported(Unsupported)
InvalidUrl(String)
InvalidRequest(String)
Timeout
Connect
The server was not reached, or the connection failed. A page reports a refused cross-origin response the same way.
Blocked(String)
Status(StatusCode)
Body(String)
TooLarge
Redirect
Closed
ClosedWith
Protocol(String)
Implementations§
Source§impl NetError
impl NetError
pub fn is_timeout(&self) -> bool
pub fn is_connect(&self) -> bool
pub fn may_be_cors(&self) -> bool
pub fn status(&self) -> Option<StatusCode>
Trait Implementations§
impl Eq for NetError
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()
Source§impl From<Unsupported<Feature>> for NetError
impl From<Unsupported<Feature>> for NetError
Source§fn from(source: Unsupported) -> Self
fn from(source: Unsupported) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for NetError
Auto Trait Implementations§
impl Forget for NetError
impl Freeze for NetError
impl Move for NetError
impl RefUnwindSafe for NetError
impl Send for NetError
impl Sync for NetError
impl Unpin for NetError
impl UnsafeUnpin for NetError
impl UnwindSafe 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