Struct curl::Error

pub struct Error { /* fields hidden */ }
Documentation

An error returned from various “easy” operations.

This structure wraps a CURLcode.

Implementations

impl Error
pub fn new(code: curl_sys::CURLcode) -> Error

Creates a new error from the underlying code returned by libcurl.

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.

pub fn is_unsupported_protocol(&Self) -> bool

Returns whether this error corresponds to CURLE_UNSUPPORTED_PROTOCOL.

pub fn is_failed_init(&Self) -> bool

Returns whether this error corresponds to CURLE_FAILED_INIT.

pub fn is_url_malformed(&Self) -> bool

Returns whether this error corresponds to CURLE_URL_MALFORMAT.

pub fn is_couldnt_resolve_proxy(&Self) -> bool

Returns whether this error corresponds to CURLE_COULDNT_RESOLVE_PROXY.

pub fn is_couldnt_resolve_host(&Self) -> bool

Returns whether this error corresponds to CURLE_COULDNT_RESOLVE_HOST.

pub fn is_couldnt_connect(&Self) -> bool

Returns whether this error corresponds to CURLE_COULDNT_CONNECT.

pub fn is_remote_access_denied(&Self) -> bool

Returns whether this error corresponds to CURLE_REMOTE_ACCESS_DENIED.

pub fn is_partial_file(&Self) -> bool

Returns whether this error corresponds to CURLE_PARTIAL_FILE.

pub fn is_quote_error(&Self) -> bool

Returns whether this error corresponds to CURLE_QUOTE_ERROR.

pub fn is_http_returned_error(&Self) -> bool

Returns whether this error corresponds to CURLE_HTTP_RETURNED_ERROR.

pub fn is_read_error(&Self) -> bool

Returns whether this error corresponds to CURLE_READ_ERROR.

pub fn is_write_error(&Self) -> bool

Returns whether this error corresponds to CURLE_WRITE_ERROR.

pub fn is_upload_failed(&Self) -> bool

Returns whether this error corresponds to CURLE_UPLOAD_FAILED.

pub fn is_out_of_memory(&Self) -> bool

Returns whether this error corresponds to CURLE_OUT_OF_MEMORY.

pub fn is_operation_timedout(&Self) -> bool

Returns whether this error corresponds to CURLE_OPERATION_TIMEDOUT.

pub fn is_range_error(&Self) -> bool

Returns whether this error corresponds to CURLE_RANGE_ERROR.

pub fn is_http_post_error(&Self) -> bool

Returns whether this error corresponds to CURLE_HTTP_POST_ERROR.

pub fn is_ssl_connect_error(&Self) -> bool

Returns whether this error corresponds to CURLE_SSL_CONNECT_ERROR.

pub fn is_bad_download_resume(&Self) -> bool

Returns whether this error corresponds to CURLE_BAD_DOWNLOAD_RESUME.

pub fn is_file_couldnt_read_file(&Self) -> bool

Returns whether this error corresponds to CURLE_FILE_COULDNT_READ_FILE.

pub fn is_function_not_found(&Self) -> bool

Returns whether this error corresponds to CURLE_FUNCTION_NOT_FOUND.

pub fn is_aborted_by_callback(&Self) -> bool

Returns whether this error corresponds to CURLE_ABORTED_BY_CALLBACK.

pub fn is_bad_function_argument(&Self) -> bool

Returns whether this error corresponds to CURLE_BAD_FUNCTION_ARGUMENT.

pub fn is_interface_failed(&Self) -> bool

Returns whether this error corresponds to CURLE_INTERFACE_FAILED.

pub fn is_too_many_redirects(&Self) -> bool

Returns whether this error corresponds to CURLE_TOO_MANY_REDIRECTS.

pub fn is_unknown_option(&Self) -> bool

Returns whether this error corresponds to CURLE_UNKNOWN_OPTION.

pub fn is_peer_failed_verification(&Self) -> bool

Returns whether this error corresponds to CURLE_PEER_FAILED_VERIFICATION.

pub fn is_got_nothing(&Self) -> bool

Returns whether this error corresponds to CURLE_GOT_NOTHING.

pub fn is_ssl_engine_notfound(&Self) -> bool

Returns whether this error corresponds to CURLE_SSL_ENGINE_NOTFOUND.

pub fn is_ssl_engine_setfailed(&Self) -> bool

Returns whether this error corresponds to CURLE_SSL_ENGINE_SETFAILED.

pub fn is_send_error(&Self) -> bool

Returns whether this error corresponds to CURLE_SEND_ERROR.

pub fn is_recv_error(&Self) -> bool

Returns whether this error corresponds to CURLE_RECV_ERROR.

pub fn is_ssl_certproblem(&Self) -> bool

Returns whether this error corresponds to CURLE_SSL_CERTPROBLEM.

pub fn is_ssl_cipher(&Self) -> bool

Returns whether this error corresponds to CURLE_SSL_CIPHER.

pub fn is_ssl_cacert(&Self) -> bool

Returns whether this error corresponds to CURLE_SSL_CACERT.

pub fn is_bad_content_encoding(&Self) -> bool

Returns whether this error corresponds to CURLE_BAD_CONTENT_ENCODING.

pub fn is_filesize_exceeded(&Self) -> bool

Returns whether this error corresponds to CURLE_FILESIZE_EXCEEDED.

pub fn is_use_ssl_failed(&Self) -> bool

Returns whether this error corresponds to CURLE_USE_SSL_FAILED.

pub fn is_send_fail_rewind(&Self) -> bool

Returns whether this error corresponds to CURLE_SEND_FAIL_REWIND.

pub fn is_ssl_engine_initfailed(&Self) -> bool

Returns whether this error corresponds to CURLE_SSL_ENGINE_INITFAILED.

pub fn is_login_denied(&Self) -> bool

Returns whether this error corresponds to CURLE_LOGIN_DENIED.

pub fn is_conv_failed(&Self) -> bool

Returns whether this error corresponds to CURLE_CONV_FAILED.

pub fn is_conv_required(&Self) -> bool

Returns whether this error corresponds to CURLE_CONV_REQD.

pub fn is_ssl_cacert_badfile(&Self) -> bool

Returns whether this error corresponds to CURLE_SSL_CACERT_BADFILE.

pub fn is_ssl_crl_badfile(&Self) -> bool

Returns whether this error corresponds to CURLE_SSL_CRL_BADFILE.

pub fn is_ssl_shutdown_failed(&Self) -> bool

Returns whether this error corresponds to CURLE_SSL_SHUTDOWN_FAILED.

pub fn is_again(&Self) -> bool

Returns whether this error corresponds to CURLE_AGAIN.

pub fn is_ssl_issuer_error(&Self) -> bool

Returns whether this error corresponds to CURLE_SSL_ISSUER_ERROR.

pub fn is_chunk_failed(&Self) -> bool

Returns whether this error corresponds to CURLE_CHUNK_FAILED.

pub fn is_http2_error(&Self) -> bool

Returns whether this error corresponds to CURLE_HTTP2.

pub fn is_http2_stream_error(&Self) -> bool

Returns whether this error corresponds to CURLE_HTTP2_STREAM.

pub fn code(&Self) -> curl_sys::CURLcode

Returns the value of the underlying error corresponding to libcurl.

pub fn description(&Self) -> &str

Returns the general description of this error code, using curl’s builtin strerror-like functionality.

pub fn extra_description(&Self) -> Option<&str>

Returns the extra description of this error, if any is available.

Trait Implementations

impl Clone for Error
fn clone(&Self) -> Error
impl Debug for Error
fn fmt(&Self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Display for Error
fn fmt(&Self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Error for Error
impl From<Error> for io::Error
fn from(e: Error) -> io::Error
impl From<NulError> for Error
fn from(_: ffi::NulError) -> Error
impl PartialEq<Error> for Error
fn eq(&Self, other: &Error) -> bool
fn ne(&Self, other: &Error) -> bool

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

impl<T> Any for T
where
    T: 'static + ?Sized,
fn type_id(&Self) -> TypeId
impl<T> Borrow<T> for T
where
    T: ?Sized,
fn borrow(&Self) -> &T
impl<T> BorrowMut<T> for T
where
    T: ?Sized,
fn borrow_mut(&mut Self) -> &mut T
impl<T> From<T> for T
fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for T
where
    U: From<T>,
fn into(Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

impl<T> ToOwned for T
where
    T: Clone,
type Owned = T
fn to_owned(&Self) -> T
fn clone_into(&Self, target: &mut T)
impl<T> ToString for T
where
    T: Display + ?Sized,
fn to_string(&Self) -> String
impl<T, U> TryFrom<U> for T
where
    U: Into<T>,
type Error = Infallible
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for T
where
    U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn try_into(Self) -> Result<U, <U as TryFrom<T>>::Error>