Enum jsonrpc::http::simple_http::Error
source · pub enum Error {
InvalidUrl {
url: String,
reason: &'static str,
},
SocketError(Error),
HttpResponseTooShort {
actual: usize,
needed: usize,
},
HttpResponseNonAsciiHello(Vec<u8>),
HttpResponseBadHello {
actual: String,
expected: String,
},
HttpResponseBadStatus(String, ParseIntError),
HttpResponseBadContentLength(String, ParseIntError),
HttpResponseContentLengthTooLarge {
length: u64,
max: u64,
},
HttpResponseChunked,
HttpErrorCode(u16),
IncompleteResponse {
content_length: u64,
n_read: u64,
},
Json(Error),
}
Expand description
Error that can happen when sending requests.
Variants§
InvalidUrl
An invalid URL was passed.
SocketError(Error)
An error occurred on the socket layer.
HttpResponseTooShort
The HTTP response was too short to even fit a HTTP 1.1 header.
HttpResponseNonAsciiHello(Vec<u8>)
The HTTP response started with a HTTP/1.1 line which was not ASCII.
HttpResponseBadHello
Fields
The HTTP response did not start with HTTP/1.1
HttpResponseBadStatus(String, ParseIntError)
Could not parse the status value as a number.
HttpResponseBadContentLength(String, ParseIntError)
Could not parse the status value as a number.
HttpResponseContentLengthTooLarge
Fields
The indicated content-length header exceeded our maximum.
HttpResponseChunked
The server is replying with chunked encoding which is not supported
HttpErrorCode(u16)
Unexpected HTTP error code (non-200).
IncompleteResponse
Fields
Received EOF before getting as many bytes as were indicated by the content-length header.
Json(Error)
JSON parsing error.
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)>
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 Error
impl Send for Error
impl Sync for Error
impl Unpin 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