pub struct Error { /* private fields */ }
Expand description
An error returned from various “easy” operations.
This structure wraps a CURLcode
.
Implementations§
Source§impl Error
impl Error
Sourcepub fn new(code: CURLcode) -> Error
pub fn new(code: CURLcode) -> Error
Creates a new error from the underlying code returned by libcurl.
Sourcepub fn set_extra(&mut self, extra: String)
pub fn set_extra(&mut self, extra: String)
Stores some extra information about this error inside this error.
This is typically used with take_error_buf
on the easy handles to
couple the extra CURLOPT_ERRORBUFFER
information with an Error
being
returned.
Sourcepub fn is_unsupported_protocol(&self) -> bool
pub fn is_unsupported_protocol(&self) -> bool
Returns whether this error corresponds to CURLE_UNSUPPORTED_PROTOCOL.
Sourcepub fn is_failed_init(&self) -> bool
pub fn is_failed_init(&self) -> bool
Returns whether this error corresponds to CURLE_FAILED_INIT.
Sourcepub fn is_url_malformed(&self) -> bool
pub fn is_url_malformed(&self) -> bool
Returns whether this error corresponds to CURLE_URL_MALFORMAT.
Sourcepub fn is_couldnt_resolve_proxy(&self) -> bool
pub fn is_couldnt_resolve_proxy(&self) -> bool
Returns whether this error corresponds to CURLE_COULDNT_RESOLVE_PROXY.
Sourcepub fn is_couldnt_resolve_host(&self) -> bool
pub fn is_couldnt_resolve_host(&self) -> bool
Returns whether this error corresponds to CURLE_COULDNT_RESOLVE_HOST.
Sourcepub fn is_couldnt_connect(&self) -> bool
pub fn is_couldnt_connect(&self) -> bool
Returns whether this error corresponds to CURLE_COULDNT_CONNECT.
Sourcepub fn is_remote_access_denied(&self) -> bool
pub fn is_remote_access_denied(&self) -> bool
Returns whether this error corresponds to CURLE_REMOTE_ACCESS_DENIED.
Sourcepub fn is_partial_file(&self) -> bool
pub fn is_partial_file(&self) -> bool
Returns whether this error corresponds to CURLE_PARTIAL_FILE.
Sourcepub fn is_quote_error(&self) -> bool
pub fn is_quote_error(&self) -> bool
Returns whether this error corresponds to CURLE_QUOTE_ERROR.
Sourcepub fn is_http_returned_error(&self) -> bool
pub fn is_http_returned_error(&self) -> bool
Returns whether this error corresponds to CURLE_HTTP_RETURNED_ERROR.
Sourcepub fn is_read_error(&self) -> bool
pub fn is_read_error(&self) -> bool
Returns whether this error corresponds to CURLE_READ_ERROR.
Sourcepub fn is_write_error(&self) -> bool
pub fn is_write_error(&self) -> bool
Returns whether this error corresponds to CURLE_WRITE_ERROR.
Sourcepub fn is_upload_failed(&self) -> bool
pub fn is_upload_failed(&self) -> bool
Returns whether this error corresponds to CURLE_UPLOAD_FAILED.
Sourcepub fn is_out_of_memory(&self) -> bool
pub fn is_out_of_memory(&self) -> bool
Returns whether this error corresponds to CURLE_OUT_OF_MEMORY.
Sourcepub fn is_operation_timedout(&self) -> bool
pub fn is_operation_timedout(&self) -> bool
Returns whether this error corresponds to CURLE_OPERATION_TIMEDOUT.
Sourcepub fn is_range_error(&self) -> bool
pub fn is_range_error(&self) -> bool
Returns whether this error corresponds to CURLE_RANGE_ERROR.
Sourcepub fn is_http_post_error(&self) -> bool
pub fn is_http_post_error(&self) -> bool
Returns whether this error corresponds to CURLE_HTTP_POST_ERROR.
Sourcepub fn is_ssl_connect_error(&self) -> bool
pub fn is_ssl_connect_error(&self) -> bool
Returns whether this error corresponds to CURLE_SSL_CONNECT_ERROR.
Sourcepub fn is_bad_download_resume(&self) -> bool
pub fn is_bad_download_resume(&self) -> bool
Returns whether this error corresponds to CURLE_BAD_DOWNLOAD_RESUME.
Sourcepub fn is_file_couldnt_read_file(&self) -> bool
pub fn is_file_couldnt_read_file(&self) -> bool
Returns whether this error corresponds to CURLE_FILE_COULDNT_READ_FILE.
Sourcepub fn is_function_not_found(&self) -> bool
pub fn is_function_not_found(&self) -> bool
Returns whether this error corresponds to CURLE_FUNCTION_NOT_FOUND.
Sourcepub fn is_aborted_by_callback(&self) -> bool
pub fn is_aborted_by_callback(&self) -> bool
Returns whether this error corresponds to CURLE_ABORTED_BY_CALLBACK.
Sourcepub fn is_bad_function_argument(&self) -> bool
pub fn is_bad_function_argument(&self) -> bool
Returns whether this error corresponds to CURLE_BAD_FUNCTION_ARGUMENT.
Sourcepub fn is_interface_failed(&self) -> bool
pub fn is_interface_failed(&self) -> bool
Returns whether this error corresponds to CURLE_INTERFACE_FAILED.
Sourcepub fn is_too_many_redirects(&self) -> bool
pub fn is_too_many_redirects(&self) -> bool
Returns whether this error corresponds to CURLE_TOO_MANY_REDIRECTS.
Sourcepub fn is_unknown_option(&self) -> bool
pub fn is_unknown_option(&self) -> bool
Returns whether this error corresponds to CURLE_UNKNOWN_OPTION.
Sourcepub fn is_peer_failed_verification(&self) -> bool
pub fn is_peer_failed_verification(&self) -> bool
Returns whether this error corresponds to CURLE_PEER_FAILED_VERIFICATION.
Sourcepub fn is_got_nothing(&self) -> bool
pub fn is_got_nothing(&self) -> bool
Returns whether this error corresponds to CURLE_GOT_NOTHING.
Sourcepub fn is_ssl_engine_notfound(&self) -> bool
pub fn is_ssl_engine_notfound(&self) -> bool
Returns whether this error corresponds to CURLE_SSL_ENGINE_NOTFOUND.
Sourcepub fn is_ssl_engine_setfailed(&self) -> bool
pub fn is_ssl_engine_setfailed(&self) -> bool
Returns whether this error corresponds to CURLE_SSL_ENGINE_SETFAILED.
Sourcepub fn is_send_error(&self) -> bool
pub fn is_send_error(&self) -> bool
Returns whether this error corresponds to CURLE_SEND_ERROR.
Sourcepub fn is_recv_error(&self) -> bool
pub fn is_recv_error(&self) -> bool
Returns whether this error corresponds to CURLE_RECV_ERROR.
Sourcepub fn is_ssl_certproblem(&self) -> bool
pub fn is_ssl_certproblem(&self) -> bool
Returns whether this error corresponds to CURLE_SSL_CERTPROBLEM.
Sourcepub fn is_ssl_cipher(&self) -> bool
pub fn is_ssl_cipher(&self) -> bool
Returns whether this error corresponds to CURLE_SSL_CIPHER.
Sourcepub fn is_ssl_cacert(&self) -> bool
pub fn is_ssl_cacert(&self) -> bool
Returns whether this error corresponds to CURLE_SSL_CACERT.
Sourcepub fn is_bad_content_encoding(&self) -> bool
pub fn is_bad_content_encoding(&self) -> bool
Returns whether this error corresponds to CURLE_BAD_CONTENT_ENCODING.
Sourcepub fn is_filesize_exceeded(&self) -> bool
pub fn is_filesize_exceeded(&self) -> bool
Returns whether this error corresponds to CURLE_FILESIZE_EXCEEDED.
Sourcepub fn is_use_ssl_failed(&self) -> bool
pub fn is_use_ssl_failed(&self) -> bool
Returns whether this error corresponds to CURLE_USE_SSL_FAILED.
Sourcepub fn is_send_fail_rewind(&self) -> bool
pub fn is_send_fail_rewind(&self) -> bool
Returns whether this error corresponds to CURLE_SEND_FAIL_REWIND.
Sourcepub fn is_ssl_engine_initfailed(&self) -> bool
pub fn is_ssl_engine_initfailed(&self) -> bool
Returns whether this error corresponds to CURLE_SSL_ENGINE_INITFAILED.
Sourcepub fn is_login_denied(&self) -> bool
pub fn is_login_denied(&self) -> bool
Returns whether this error corresponds to CURLE_LOGIN_DENIED.
Sourcepub fn is_conv_failed(&self) -> bool
pub fn is_conv_failed(&self) -> bool
Returns whether this error corresponds to CURLE_CONV_FAILED.
Sourcepub fn is_conv_required(&self) -> bool
pub fn is_conv_required(&self) -> bool
Returns whether this error corresponds to CURLE_CONV_REQD.
Sourcepub fn is_ssl_cacert_badfile(&self) -> bool
pub fn is_ssl_cacert_badfile(&self) -> bool
Returns whether this error corresponds to CURLE_SSL_CACERT_BADFILE.
Sourcepub fn is_ssl_crl_badfile(&self) -> bool
pub fn is_ssl_crl_badfile(&self) -> bool
Returns whether this error corresponds to CURLE_SSL_CRL_BADFILE.
Sourcepub fn is_ssl_shutdown_failed(&self) -> bool
pub fn is_ssl_shutdown_failed(&self) -> bool
Returns whether this error corresponds to CURLE_SSL_SHUTDOWN_FAILED.
Sourcepub fn is_ssl_issuer_error(&self) -> bool
pub fn is_ssl_issuer_error(&self) -> bool
Returns whether this error corresponds to CURLE_SSL_ISSUER_ERROR.
Sourcepub fn is_chunk_failed(&self) -> bool
pub fn is_chunk_failed(&self) -> bool
Returns whether this error corresponds to CURLE_CHUNK_FAILED.
Sourcepub fn is_http2_error(&self) -> bool
pub fn is_http2_error(&self) -> bool
Returns whether this error corresponds to CURLE_HTTP2.
Sourcepub fn is_http2_stream_error(&self) -> bool
pub fn is_http2_stream_error(&self) -> bool
Returns whether this error corresponds to CURLE_HTTP2_STREAM.
Sourcepub fn code(&self) -> CURLcode
pub fn code(&self) -> CURLcode
Returns the value of the underlying error corresponding to libcurl.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Returns the general description of this error code, using curl’s
builtin strerror
-like functionality.
Sourcepub fn extra_description(&self) -> Option<&str>
pub fn extra_description(&self) -> Option<&str>
Returns the extra description of this error, if any is available.