Struct curl::Error

source ·
pub struct Error { /* private fields */ }
Expand description

An error returned from various “easy” operations.

This structure wraps a CURLcode.

Implementations§

source§

impl Error

source

pub fn new(code: CURLcode) -> Error

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

source

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.

source

pub fn is_unsupported_protocol(&self) -> bool

Returns whether this error corresponds to CURLE_UNSUPPORTED_PROTOCOL.

source

pub fn is_failed_init(&self) -> bool

Returns whether this error corresponds to CURLE_FAILED_INIT.

source

pub fn is_url_malformed(&self) -> bool

Returns whether this error corresponds to CURLE_URL_MALFORMAT.

source

pub fn is_couldnt_resolve_proxy(&self) -> bool

Returns whether this error corresponds to CURLE_COULDNT_RESOLVE_PROXY.

source

pub fn is_couldnt_resolve_host(&self) -> bool

Returns whether this error corresponds to CURLE_COULDNT_RESOLVE_HOST.

source

pub fn is_couldnt_connect(&self) -> bool

Returns whether this error corresponds to CURLE_COULDNT_CONNECT.

source

pub fn is_remote_access_denied(&self) -> bool

Returns whether this error corresponds to CURLE_REMOTE_ACCESS_DENIED.

source

pub fn is_partial_file(&self) -> bool

Returns whether this error corresponds to CURLE_PARTIAL_FILE.

source

pub fn is_quote_error(&self) -> bool

Returns whether this error corresponds to CURLE_QUOTE_ERROR.

source

pub fn is_http_returned_error(&self) -> bool

Returns whether this error corresponds to CURLE_HTTP_RETURNED_ERROR.

source

pub fn is_read_error(&self) -> bool

Returns whether this error corresponds to CURLE_READ_ERROR.

source

pub fn is_write_error(&self) -> bool

Returns whether this error corresponds to CURLE_WRITE_ERROR.

source

pub fn is_upload_failed(&self) -> bool

Returns whether this error corresponds to CURLE_UPLOAD_FAILED.

source

pub fn is_out_of_memory(&self) -> bool

Returns whether this error corresponds to CURLE_OUT_OF_MEMORY.

source

pub fn is_operation_timedout(&self) -> bool

Returns whether this error corresponds to CURLE_OPERATION_TIMEDOUT.

source

pub fn is_range_error(&self) -> bool

Returns whether this error corresponds to CURLE_RANGE_ERROR.

source

pub fn is_http_post_error(&self) -> bool

Returns whether this error corresponds to CURLE_HTTP_POST_ERROR.

source

pub fn is_ssl_connect_error(&self) -> bool

Returns whether this error corresponds to CURLE_SSL_CONNECT_ERROR.

source

pub fn is_bad_download_resume(&self) -> bool

Returns whether this error corresponds to CURLE_BAD_DOWNLOAD_RESUME.

source

pub fn is_file_couldnt_read_file(&self) -> bool

Returns whether this error corresponds to CURLE_FILE_COULDNT_READ_FILE.

source

pub fn is_function_not_found(&self) -> bool

Returns whether this error corresponds to CURLE_FUNCTION_NOT_FOUND.

source

pub fn is_aborted_by_callback(&self) -> bool

Returns whether this error corresponds to CURLE_ABORTED_BY_CALLBACK.

source

pub fn is_bad_function_argument(&self) -> bool

Returns whether this error corresponds to CURLE_BAD_FUNCTION_ARGUMENT.

source

pub fn is_interface_failed(&self) -> bool

Returns whether this error corresponds to CURLE_INTERFACE_FAILED.

source

pub fn is_too_many_redirects(&self) -> bool

Returns whether this error corresponds to CURLE_TOO_MANY_REDIRECTS.

source

pub fn is_unknown_option(&self) -> bool

Returns whether this error corresponds to CURLE_UNKNOWN_OPTION.

source

pub fn is_peer_failed_verification(&self) -> bool

Returns whether this error corresponds to CURLE_PEER_FAILED_VERIFICATION.

source

pub fn is_got_nothing(&self) -> bool

Returns whether this error corresponds to CURLE_GOT_NOTHING.

source

pub fn is_ssl_engine_notfound(&self) -> bool

Returns whether this error corresponds to CURLE_SSL_ENGINE_NOTFOUND.

source

pub fn is_ssl_engine_setfailed(&self) -> bool

Returns whether this error corresponds to CURLE_SSL_ENGINE_SETFAILED.

source

pub fn is_send_error(&self) -> bool

Returns whether this error corresponds to CURLE_SEND_ERROR.

source

pub fn is_recv_error(&self) -> bool

Returns whether this error corresponds to CURLE_RECV_ERROR.

source

pub fn is_ssl_certproblem(&self) -> bool

Returns whether this error corresponds to CURLE_SSL_CERTPROBLEM.

source

pub fn is_ssl_cipher(&self) -> bool

Returns whether this error corresponds to CURLE_SSL_CIPHER.

source

pub fn is_ssl_cacert(&self) -> bool

Returns whether this error corresponds to CURLE_SSL_CACERT.

source

pub fn is_bad_content_encoding(&self) -> bool

Returns whether this error corresponds to CURLE_BAD_CONTENT_ENCODING.

source

pub fn is_filesize_exceeded(&self) -> bool

Returns whether this error corresponds to CURLE_FILESIZE_EXCEEDED.

source

pub fn is_use_ssl_failed(&self) -> bool

Returns whether this error corresponds to CURLE_USE_SSL_FAILED.

source

pub fn is_send_fail_rewind(&self) -> bool

Returns whether this error corresponds to CURLE_SEND_FAIL_REWIND.

source

pub fn is_ssl_engine_initfailed(&self) -> bool

Returns whether this error corresponds to CURLE_SSL_ENGINE_INITFAILED.

source

pub fn is_login_denied(&self) -> bool

Returns whether this error corresponds to CURLE_LOGIN_DENIED.

source

pub fn is_conv_failed(&self) -> bool

Returns whether this error corresponds to CURLE_CONV_FAILED.

source

pub fn is_conv_required(&self) -> bool

Returns whether this error corresponds to CURLE_CONV_REQD.

source

pub fn is_ssl_cacert_badfile(&self) -> bool

Returns whether this error corresponds to CURLE_SSL_CACERT_BADFILE.

source

pub fn is_ssl_crl_badfile(&self) -> bool

Returns whether this error corresponds to CURLE_SSL_CRL_BADFILE.

source

pub fn is_ssl_shutdown_failed(&self) -> bool

Returns whether this error corresponds to CURLE_SSL_SHUTDOWN_FAILED.

source

pub fn is_again(&self) -> bool

Returns whether this error corresponds to CURLE_AGAIN.

source

pub fn is_ssl_issuer_error(&self) -> bool

Returns whether this error corresponds to CURLE_SSL_ISSUER_ERROR.

source

pub fn is_chunk_failed(&self) -> bool

Returns whether this error corresponds to CURLE_CHUNK_FAILED.

source

pub fn is_http2_error(&self) -> bool

Returns whether this error corresponds to CURLE_HTTP2.

source

pub fn is_http2_stream_error(&self) -> bool

Returns whether this error corresponds to CURLE_HTTP2_STREAM.

source

pub fn code(&self) -> CURLcode

Returns the value of the underlying error corresponding to libcurl.

source

pub fn description(&self) -> &str

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

source

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

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

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Error

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Error

Converts to this type from the input type.
source§

impl From<NulError> for Error

source§

fn from(_: NulError) -> Error

Converts to this type from the input type.
source§

impl PartialEq for Error

source§

fn eq(&self, other: &Error) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.