#[non_exhaustive]pub enum Error {
Show 31 variants
InvalidUri {
uri: String,
},
InvalidNoProxyRule {
rule: String,
},
InvalidProxyConfig {
proxy_uri: String,
message: String,
},
ProxyAuthorizationRequiresHttpProxy,
InvalidAdaptiveConcurrencyPolicy {
min_limit: usize,
initial_limit: usize,
max_limit: usize,
message: &'static str,
},
SerializeJson {
source: Error,
},
SerializeQuery {
source: Error,
},
SerializeForm {
source: Error,
},
RequestBuild {
source: Error,
},
Transport {
kind: TransportErrorKind,
method: Method,
uri: String,
source: Box<dyn Error + Send + Sync>,
},
Timeout {
phase: TimeoutPhase,
timeout_ms: u128,
method: Method,
uri: String,
},
DeadlineExceeded {
timeout_ms: u128,
method: Method,
uri: String,
},
ReadBody {
source: Box<dyn Error + Send + Sync>,
},
WriteBody {
method: Method,
uri: String,
source: Box<dyn Error + Send + Sync>,
},
ResponseBodyTooLarge {
limit_bytes: usize,
actual_bytes: usize,
method: Method,
uri: String,
},
HttpStatus {
status: u16,
method: Method,
uri: String,
headers: Box<HeaderMap>,
body: String,
},
DeserializeJson {
source: Error,
body: String,
},
DecodeText {
source: Utf8Error,
body: String,
},
InvalidHeaderName {
name: String,
source: InvalidHeaderName,
},
InvalidHeaderValue {
name: String,
source: InvalidHeaderValue,
},
DecodeContentEncoding {
encoding: String,
method: Method,
uri: String,
message: String,
},
ConcurrencyLimitClosed,
TlsBackendUnavailable {
backend: &'static str,
},
TlsBackendInit {
backend: &'static str,
message: String,
},
TlsConfig {
backend: &'static str,
message: String,
},
RetryBudgetExhausted {
method: Method,
uri: String,
},
CircuitOpen {
method: Method,
uri: String,
retry_after_ms: u128,
},
MissingRedirectLocation {
status: u16,
method: Method,
uri: String,
},
InvalidRedirectLocation {
location: String,
method: Method,
uri: String,
},
RedirectLimitExceeded {
max_redirects: usize,
method: Method,
uri: String,
},
RedirectBodyNotReplayable {
method: Method,
uri: 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.
InvalidUri
InvalidNoProxyRule
InvalidProxyConfig
ProxyAuthorizationRequiresHttpProxy
InvalidAdaptiveConcurrencyPolicy
SerializeJson
SerializeQuery
SerializeForm
RequestBuild
Transport
Timeout
DeadlineExceeded
ReadBody
WriteBody
ResponseBodyTooLarge
HttpStatus
DeserializeJson
DecodeText
InvalidHeaderName
InvalidHeaderValue
DecodeContentEncoding
ConcurrencyLimitClosed
TlsBackendInit
TlsConfig
RetryBudgetExhausted
CircuitOpen
MissingRedirectLocation
InvalidRedirectLocation
RedirectLimitExceeded
RedirectBodyNotReplayable
Implementations§
Source§impl Error
impl Error
pub const fn code(&self) -> ErrorCode
pub const fn status_code(&self) -> Option<u16>
pub const fn response_headers(&self) -> Option<&HeaderMap>
pub fn retry_after(&self, now: SystemTime) -> Option<Duration>
pub fn request_id(&self) -> Option<&str>
pub fn request_method(&self) -> Option<&Method>
pub fn request_uri_redacted(&self) -> Option<&str>
pub fn request_uri_redacted_owned(&self) -> Option<String>
pub fn request_path(&self) -> Option<String>
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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