pub struct Error { /* private fields */ }
Expand description
An error returned from various “easy” operations.
This structure wraps a CURLcode
.
Implementations
sourceimpl 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.
Trait Implementations
sourceimpl Error for Error
impl Error for Error
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl StructuralPartialEq for Error
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more