diff --git a/.lock b/.lock new file mode 100644 index 000000000..e69de29bb diff --git a/crates.js b/crates.js new file mode 100644 index 000000000..e51e41988 --- /dev/null +++ b/crates.js @@ -0,0 +1 @@ +window.ALL_CRATES = ["curl"]; \ No newline at end of file diff --git a/curl/all.html b/curl/all.html new file mode 100644 index 000000000..914d0a598 --- /dev/null +++ b/curl/all.html @@ -0,0 +1,2 @@ +List of all items in this crate +

List of all items

Structs

Enums

Traits

Functions

Type Aliases

\ No newline at end of file diff --git a/curl/easy/enum.HttpVersion.html b/curl/easy/enum.HttpVersion.html new file mode 100644 index 000000000..5ae2abeb3 --- /dev/null +++ b/curl/easy/enum.HttpVersion.html @@ -0,0 +1,38 @@ +HttpVersion in curl::easy - Rust +

Enum curl::easy::HttpVersion

source ·
#[non_exhaustive]
pub enum HttpVersion { + Any = 0, + V10 = 1, + V11 = 2, + V2 = 3, + V2TLS = 4, + V2PriorKnowledge = 5, + V3 = 30, +}
Expand description

Possible values to pass to the http_version method.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Any = 0

We don’t care what http version to use, and we’d like the library to +choose the best possible for us.

+
§

V10 = 1

Please use HTTP 1.0 in the request

+
§

V11 = 2

Please use HTTP 1.1 in the request

+
§

V2 = 3

Please use HTTP 2 in the request +(Added in CURL 7.33.0)

+
§

V2TLS = 4

Use version 2 for HTTPS, version 1.1 for HTTP +(Added in CURL 7.47.0)

+
§

V2PriorKnowledge = 5

Please use HTTP 2 without HTTP/1.1 Upgrade +(Added in CURL 7.49.0)

+
§

V3 = 30

Setting this value will make libcurl attempt to use HTTP/3 directly to +server given in the URL but fallback to earlier HTTP versions if the HTTP/3 +connection establishment fails.

+

Note: the meaning of this settings depends on the linked libcurl. +For CURL < 7.88.0, there is no fallback if HTTP/3 connection fails.

+

(Added in CURL 7.66.0)

+

Trait Implementations§

source§

impl Clone for HttpVersion

source§

fn clone(&self) -> HttpVersion

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 HttpVersion

source§

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

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

impl Copy for HttpVersion

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/easy/enum.InfoType.html b/curl/easy/enum.InfoType.html new file mode 100644 index 000000000..07598b2c8 --- /dev/null +++ b/curl/easy/enum.InfoType.html @@ -0,0 +1,30 @@ +InfoType in curl::easy - Rust +

Enum curl::easy::InfoType

source ·
#[non_exhaustive]
pub enum InfoType { + Text, + HeaderIn, + HeaderOut, + DataIn, + DataOut, + SslDataIn, + SslDataOut, +}
Expand description

Possible data chunks that can be witnessed as part of the debug_function +callback.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Text

The data is informational text.

+
§

HeaderIn

The data is header (or header-like) data received from the peer.

+
§

HeaderOut

The data is header (or header-like) data sent to the peer.

+
§

DataIn

The data is protocol data received from the peer.

+
§

DataOut

The data is protocol data sent to the peer.

+
§

SslDataIn

The data is SSL/TLS (binary) data received from the peer.

+
§

SslDataOut

The data is SSL/TLS (binary) data sent to the peer.

+

Trait Implementations§

source§

impl Clone for InfoType

source§

fn clone(&self) -> InfoType

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 InfoType

source§

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

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

impl Copy for InfoType

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/easy/enum.IpResolve.html b/curl/easy/enum.IpResolve.html new file mode 100644 index 000000000..4e370dd06 --- /dev/null +++ b/curl/easy/enum.IpResolve.html @@ -0,0 +1,18 @@ +IpResolve in curl::easy - Rust +

Enum curl::easy::IpResolve

source ·
#[non_exhaustive]
pub enum IpResolve { + V4 = 1, + V6 = 2, + Any = 0, +}
Expand description

Possible values to pass to the ip_resolve method.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

V4 = 1

§

V6 = 2

§

Any = 0

Trait Implementations§

source§

impl Clone for IpResolve

source§

fn clone(&self) -> IpResolve

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 IpResolve

source§

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

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

impl Copy for IpResolve

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/easy/enum.NetRc.html b/curl/easy/enum.NetRc.html new file mode 100644 index 000000000..8daf82860 --- /dev/null +++ b/curl/easy/enum.NetRc.html @@ -0,0 +1,26 @@ +NetRc in curl::easy - Rust +

Enum curl::easy::NetRc

source ·
pub enum NetRc {
+    Ignored = 0,
+    Optional = 1,
+    Required = 2,
+}
Expand description

Options for .netrc parsing.

+

Variants§

§

Ignored = 0

Ignoring .netrc file and use information from url

+

This option is default

+
§

Optional = 1

The use of your ~/.netrc file is optional, and information in the URL is to be +preferred. The file will be scanned for the host and user name (to find the password only) +or for the host only, to find the first user name and password after that machine, which +ever information is not specified in the URL.

+
§

Required = 2

This value tells the library that use of the file is required, to ignore the information in +the URL, and to search the file for the host only.

+

Trait Implementations§

source§

impl Clone for NetRc

source§

fn clone(&self) -> NetRc

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 NetRc

source§

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

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

impl Copy for NetRc

Auto Trait Implementations§

§

impl RefUnwindSafe for NetRc

§

impl Send for NetRc

§

impl Sync for NetRc

§

impl Unpin for NetRc

§

impl UnwindSafe for NetRc

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, 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.
\ No newline at end of file diff --git a/curl/easy/enum.ProxyType.html b/curl/easy/enum.ProxyType.html new file mode 100644 index 000000000..9af80a648 --- /dev/null +++ b/curl/easy/enum.ProxyType.html @@ -0,0 +1,21 @@ +ProxyType in curl::easy - Rust +

Enum curl::easy::ProxyType

source ·
#[non_exhaustive]
pub enum ProxyType { + Http = 0, + Http1 = 1, + Socks4 = 4, + Socks5 = 5, + Socks4a = 6, + Socks5Hostname = 7, +}
Expand description

Possible proxy types that libcurl currently understands.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Http = 0

§

Http1 = 1

§

Socks4 = 4

§

Socks5 = 5

§

Socks4a = 6

§

Socks5Hostname = 7

Trait Implementations§

source§

impl Clone for ProxyType

source§

fn clone(&self) -> ProxyType

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 ProxyType

source§

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

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

impl Copy for ProxyType

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/easy/enum.ReadError.html b/curl/easy/enum.ReadError.html new file mode 100644 index 000000000..9aa5b92c0 --- /dev/null +++ b/curl/easy/enum.ReadError.html @@ -0,0 +1,18 @@ +ReadError in curl::easy - Rust +

Enum curl::easy::ReadError

source ·
#[non_exhaustive]
pub enum ReadError { + Abort, + Pause, +}
Expand description

Possible error codes that can be returned from the read_function callback.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Abort

Indicates that the connection should be aborted immediately

+
§

Pause

Indicates that reading should be paused until unpause is called.

+

Trait Implementations§

source§

impl Debug for ReadError

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/easy/enum.SeekResult.html b/curl/easy/enum.SeekResult.html new file mode 100644 index 000000000..a4168a1be --- /dev/null +++ b/curl/easy/enum.SeekResult.html @@ -0,0 +1,23 @@ +SeekResult in curl::easy - Rust +

Enum curl::easy::SeekResult

source ·
#[non_exhaustive]
pub enum SeekResult { + Ok = 0, + Fail = 1, + CantSeek = 2, +}
Expand description

Possible return values from the seek_function callback.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Ok = 0

Indicates that the seek operation was a success

+
§

Fail = 1

Indicates that the seek operation failed, and the entire request should +fail as a result.

+
§

CantSeek = 2

Indicates that although the seek failed libcurl should attempt to keep +working if possible (for example “seek” through reading).

+

Trait Implementations§

source§

impl Clone for SeekResult

source§

fn clone(&self) -> SeekResult

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 SeekResult

source§

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

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

impl Copy for SeekResult

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/easy/enum.SslVersion.html b/curl/easy/enum.SslVersion.html new file mode 100644 index 000000000..510778ad7 --- /dev/null +++ b/curl/easy/enum.SslVersion.html @@ -0,0 +1,23 @@ +SslVersion in curl::easy - Rust +

Enum curl::easy::SslVersion

source ·
#[non_exhaustive]
pub enum SslVersion { + Default = 0, + Tlsv1 = 1, + Sslv2 = 2, + Sslv3 = 3, + Tlsv10 = 4, + Tlsv11 = 5, + Tlsv12 = 6, + Tlsv13 = 7, +}
Expand description

Possible values to pass to the ssl_version and ssl_min_max_version method.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Default = 0

§

Tlsv1 = 1

§

Sslv2 = 2

§

Sslv3 = 3

§

Tlsv10 = 4

§

Tlsv11 = 5

§

Tlsv12 = 6

§

Tlsv13 = 7

Trait Implementations§

source§

impl Clone for SslVersion

source§

fn clone(&self) -> SslVersion

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 SslVersion

source§

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

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

impl Copy for SslVersion

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/easy/enum.TimeCondition.html b/curl/easy/enum.TimeCondition.html new file mode 100644 index 000000000..1dade9a52 --- /dev/null +++ b/curl/easy/enum.TimeCondition.html @@ -0,0 +1,19 @@ +TimeCondition in curl::easy - Rust +

Enum curl::easy::TimeCondition

source ·
#[non_exhaustive]
pub enum TimeCondition { + None = 0, + IfModifiedSince = 1, + IfUnmodifiedSince = 2, + LastModified = 3, +}
Expand description

Possible conditions for the time_condition method.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

None = 0

§

IfModifiedSince = 1

§

IfUnmodifiedSince = 2

§

LastModified = 3

Trait Implementations§

source§

impl Clone for TimeCondition

source§

fn clone(&self) -> TimeCondition

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 TimeCondition

source§

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

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

impl Copy for TimeCondition

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/easy/enum.WriteError.html b/curl/easy/enum.WriteError.html new file mode 100644 index 000000000..507757681 --- /dev/null +++ b/curl/easy/enum.WriteError.html @@ -0,0 +1,16 @@ +WriteError in curl::easy - Rust +

Enum curl::easy::WriteError

source ·
#[non_exhaustive]
pub enum WriteError { + Pause, +}
Expand description

Possible error codes that can be returned from the write_function callback.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Pause

Indicates that reading should be paused until unpause is called.

+

Trait Implementations§

source§

impl Debug for WriteError

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/easy/form/struct.Form.html b/curl/easy/form/struct.Form.html new file mode 100644 index 000000000..fe77735ed --- /dev/null +++ b/curl/easy/form/struct.Form.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/struct.Form.html...

+ + + \ No newline at end of file diff --git a/curl/easy/form/struct.Part.html b/curl/easy/form/struct.Part.html new file mode 100644 index 000000000..b130747cd --- /dev/null +++ b/curl/easy/form/struct.Part.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/struct.Part.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handle/struct.Easy.html b/curl/easy/handle/struct.Easy.html new file mode 100644 index 000000000..21200a0c7 --- /dev/null +++ b/curl/easy/handle/struct.Easy.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/struct.Easy.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handle/struct.Transfer.html b/curl/easy/handle/struct.Transfer.html new file mode 100644 index 000000000..a1b54d233 --- /dev/null +++ b/curl/easy/handle/struct.Transfer.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/struct.Transfer.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/enum.HttpVersion.html b/curl/easy/handler/enum.HttpVersion.html new file mode 100644 index 000000000..ea7a45116 --- /dev/null +++ b/curl/easy/handler/enum.HttpVersion.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/enum.HttpVersion.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/enum.InfoType.html b/curl/easy/handler/enum.InfoType.html new file mode 100644 index 000000000..30da50ea1 --- /dev/null +++ b/curl/easy/handler/enum.InfoType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/enum.InfoType.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/enum.IpResolve.html b/curl/easy/handler/enum.IpResolve.html new file mode 100644 index 000000000..79fd49c83 --- /dev/null +++ b/curl/easy/handler/enum.IpResolve.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/enum.IpResolve.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/enum.NetRc.html b/curl/easy/handler/enum.NetRc.html new file mode 100644 index 000000000..3faaf4200 --- /dev/null +++ b/curl/easy/handler/enum.NetRc.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/enum.NetRc.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/enum.ProxyType.html b/curl/easy/handler/enum.ProxyType.html new file mode 100644 index 000000000..142388d80 --- /dev/null +++ b/curl/easy/handler/enum.ProxyType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/enum.ProxyType.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/enum.ReadError.html b/curl/easy/handler/enum.ReadError.html new file mode 100644 index 000000000..c2e04ca19 --- /dev/null +++ b/curl/easy/handler/enum.ReadError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/enum.ReadError.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/enum.SeekResult.html b/curl/easy/handler/enum.SeekResult.html new file mode 100644 index 000000000..704a7b041 --- /dev/null +++ b/curl/easy/handler/enum.SeekResult.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/enum.SeekResult.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/enum.SslVersion.html b/curl/easy/handler/enum.SslVersion.html new file mode 100644 index 000000000..285e9b7b6 --- /dev/null +++ b/curl/easy/handler/enum.SslVersion.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/enum.SslVersion.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/enum.TimeCondition.html b/curl/easy/handler/enum.TimeCondition.html new file mode 100644 index 000000000..c1228277b --- /dev/null +++ b/curl/easy/handler/enum.TimeCondition.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/enum.TimeCondition.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/enum.WriteError.html b/curl/easy/handler/enum.WriteError.html new file mode 100644 index 000000000..5cb59af77 --- /dev/null +++ b/curl/easy/handler/enum.WriteError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/enum.WriteError.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/struct.Auth.html b/curl/easy/handler/struct.Auth.html new file mode 100644 index 000000000..0b4892421 --- /dev/null +++ b/curl/easy/handler/struct.Auth.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/struct.Auth.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/struct.Easy2.html b/curl/easy/handler/struct.Easy2.html new file mode 100644 index 000000000..1252b5a76 --- /dev/null +++ b/curl/easy/handler/struct.Easy2.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/struct.Easy2.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/struct.PostRedirections.html b/curl/easy/handler/struct.PostRedirections.html new file mode 100644 index 000000000..4a7be5995 --- /dev/null +++ b/curl/easy/handler/struct.PostRedirections.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/struct.PostRedirections.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/struct.SslOpt.html b/curl/easy/handler/struct.SslOpt.html new file mode 100644 index 000000000..565c81e61 --- /dev/null +++ b/curl/easy/handler/struct.SslOpt.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/struct.SslOpt.html...

+ + + \ No newline at end of file diff --git a/curl/easy/handler/trait.Handler.html b/curl/easy/handler/trait.Handler.html new file mode 100644 index 000000000..aebafa6fd --- /dev/null +++ b/curl/easy/handler/trait.Handler.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/trait.Handler.html...

+ + + \ No newline at end of file diff --git a/curl/easy/index.html b/curl/easy/index.html new file mode 100644 index 000000000..217004542 --- /dev/null +++ b/curl/easy/index.html @@ -0,0 +1,11 @@ +curl::easy - Rust +

Module curl::easy

source ·
Expand description

Bindings to the “easy” libcurl API.

+

This module contains some simple types like Easy and List which are just +wrappers around the corresponding libcurl types. There’s also a few enums +scattered about for various options here and there.

+

Most simple usage of libcurl will likely use the Easy structure here, and +you can find more docs about its usage on that struct.

+

Structs

  • Structure which stores possible authentication methods to get passed to +http_auth and proxy_auth.
  • Raw bindings to a libcurl “easy session”.
  • Raw bindings to a libcurl “easy session”.
  • Multipart/formdata for an HTTP POST request.
  • An iterator over List
  • A linked list of a strings
  • One part in a multipart upload, added to a Form.
  • Structure which stores possible post redirection options to pass to post_redirections.
  • Structure which stores possible ssl options to pass to ssl_options.
  • A scoped transfer of information which borrows an Easy and allows +referencing stack-local data of the lifetime 'data.

Enums

  • Possible values to pass to the http_version method.
  • Possible data chunks that can be witnessed as part of the debug_function +callback.
  • Possible values to pass to the ip_resolve method.
  • Options for .netrc parsing.
  • Possible proxy types that libcurl currently understands.
  • Possible error codes that can be returned from the read_function callback.
  • Possible return values from the seek_function callback.
  • Possible values to pass to the ssl_version and ssl_min_max_version method.
  • Possible conditions for the time_condition method.
  • Possible error codes that can be returned from the write_function callback.

Traits

  • A trait for the various callbacks used by libcurl to invoke user code.
\ No newline at end of file diff --git a/curl/easy/list/struct.Iter.html b/curl/easy/list/struct.Iter.html new file mode 100644 index 000000000..eaa96cb47 --- /dev/null +++ b/curl/easy/list/struct.Iter.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/struct.Iter.html...

+ + + \ No newline at end of file diff --git a/curl/easy/list/struct.List.html b/curl/easy/list/struct.List.html new file mode 100644 index 000000000..73d97377c --- /dev/null +++ b/curl/easy/list/struct.List.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../curl/easy/struct.List.html...

+ + + \ No newline at end of file diff --git a/curl/easy/sidebar-items.js b/curl/easy/sidebar-items.js new file mode 100644 index 000000000..aa86ccd87 --- /dev/null +++ b/curl/easy/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["HttpVersion","InfoType","IpResolve","NetRc","ProxyType","ReadError","SeekResult","SslVersion","TimeCondition","WriteError"],"struct":["Auth","Easy","Easy2","Form","Iter","List","Part","PostRedirections","SslOpt","Transfer"],"trait":["Handler"]}; \ No newline at end of file diff --git a/curl/easy/struct.Auth.html b/curl/easy/struct.Auth.html new file mode 100644 index 000000000..b175f2ddb --- /dev/null +++ b/curl/easy/struct.Auth.html @@ -0,0 +1,67 @@ +Auth in curl::easy - Rust +

Struct curl::easy::Auth

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

Structure which stores possible authentication methods to get passed to +http_auth and proxy_auth.

+

Implementations§

source§

impl Auth

source

pub fn new() -> Auth

Creates a new set of authentications with no members.

+

An Auth structure is used to configure which forms of authentication +are attempted when negotiating connections with servers.

+
source

pub fn basic(&mut self, on: bool) -> &mut Auth

HTTP Basic authentication.

+

This is the default choice, and the only method that is in wide-spread +use and supported virtually everywhere. This sends the user name and +password over the network in plain text, easily captured by others.

+
source

pub fn digest(&mut self, on: bool) -> &mut Auth

HTTP Digest authentication.

+

Digest authentication is defined in RFC 2617 and is a more secure way to +do authentication over public networks than the regular old-fashioned +Basic method.

+
source

pub fn digest_ie(&mut self, on: bool) -> &mut Auth

HTTP Digest authentication with an IE flavor.

+

Digest authentication is defined in RFC 2617 and is a more secure way to +do authentication over public networks than the regular old-fashioned +Basic method. The IE flavor is simply that libcurl will use a special +“quirk” that IE is known to have used before version 7 and that some +servers require the client to use.

+
source

pub fn gssnegotiate(&mut self, on: bool) -> &mut Auth

HTTP Negotiate (SPNEGO) authentication.

+

Negotiate authentication is defined in RFC 4559 and is the most secure +way to perform authentication over HTTP.

+

You need to build libcurl with a suitable GSS-API library or SSPI on +Windows for this to work.

+
source

pub fn ntlm(&mut self, on: bool) -> &mut Auth

HTTP NTLM authentication.

+

A proprietary protocol invented and used by Microsoft. It uses a +challenge-response and hash concept similar to Digest, to prevent the +password from being eavesdropped.

+

You need to build libcurl with either OpenSSL, GnuTLS or NSS support for +this option to work, or build libcurl on Windows with SSPI support.

+
source

pub fn ntlm_wb(&mut self, on: bool) -> &mut Auth

NTLM delegating to winbind helper.

+

Authentication is performed by a separate binary application that is +executed when needed. The name of the application is specified at +compile time but is typically /usr/bin/ntlm_auth

+

Note that libcurl will fork when necessary to run the winbind +application and kill it when complete, calling waitpid() to await its +exit when done. On POSIX operating systems, killing the process will +cause a SIGCHLD signal to be raised (regardless of whether +CURLOPT_NOSIGNAL is set), which must be handled intelligently by the +application. In particular, the application must not unconditionally +call wait() in its SIGCHLD signal handler to avoid being subject to a +race condition. This behavior is subject to change in future versions of +libcurl.

+

A proprietary protocol invented and used by Microsoft. It uses a +challenge-response and hash concept similar to Digest, to prevent the +password from being eavesdropped.

+
source

pub fn aws_sigv4(&mut self, on: bool) -> &mut Auth

HTTP AWS V4 signature authentication.

+

This is a special auth type that can’t be combined with the others. +It will override the other auth types you might have set.

+

Enabling this auth type is the same as using “aws:amz” as param in +Easy2::aws_sigv4 method.

+
source

pub fn auto(&mut self, on: bool) -> &mut Auth

HTTP Auto authentication.

+

This is a combination for CURLAUTH_BASIC | CURLAUTH_DIGEST | +CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM

+

Trait Implementations§

source§

impl Clone for Auth

source§

fn clone(&self) -> Auth

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 Auth

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Auth

§

impl Send for Auth

§

impl Sync for Auth

§

impl Unpin for Auth

§

impl UnwindSafe for Auth

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, 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.
\ No newline at end of file diff --git a/curl/easy/struct.Easy.html b/curl/easy/struct.Easy.html new file mode 100644 index 000000000..f46c75672 --- /dev/null +++ b/curl/easy/struct.Easy.html @@ -0,0 +1,521 @@ +Easy in curl::easy - Rust +

Struct curl::easy::Easy

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

Raw bindings to a libcurl “easy session”.

+

This type is the same as the Easy2 type in this library except that it +does not contain a type parameter. Callbacks from curl are all controlled +via closures on this Easy type, and this type namely has a transfer +method as well for ergonomic management of these callbacks.

+

There’s not necessarily a right answer for which type is correct to use, but +as a general rule of thumb Easy is typically a reasonable choice for +synchronous I/O and Easy2 is a good choice for asynchronous I/O.

+

Examples

+

Creating a handle which can be used later

+ +
use curl::easy::Easy;
+
+let handle = Easy::new();
+

Send an HTTP request, writing the response to stdout.

+ +
use std::io::{stdout, Write};
+
+use curl::easy::Easy;
+
+let mut handle = Easy::new();
+handle.url("https://www.rust-lang.org/").unwrap();
+handle.write_function(|data| {
+    stdout().write_all(data).unwrap();
+    Ok(data.len())
+}).unwrap();
+handle.perform().unwrap();
+

Collect all output of an HTTP request to a vector.

+ +
use curl::easy::Easy;
+
+let mut data = Vec::new();
+let mut handle = Easy::new();
+handle.url("https://www.rust-lang.org/").unwrap();
+{
+    let mut transfer = handle.transfer();
+    transfer.write_function(|new_data| {
+        data.extend_from_slice(new_data);
+        Ok(new_data.len())
+    }).unwrap();
+    transfer.perform().unwrap();
+}
+println!("{:?}", data);
+

More examples of various properties of an HTTP request can be found on the +specific methods as well.

+

Implementations§

source§

impl Easy

source

pub fn new() -> Easy

Creates a new “easy” handle which is the core of almost all operations +in libcurl.

+

To use a handle, applications typically configure a number of options +followed by a call to perform. Options are preserved across calls to +perform and need to be reset manually (or via the reset method) if +this is not desired.

+
source

pub fn verbose(&mut self, verbose: bool) -> Result<(), Error>

Same as Easy2::verbose

+
source

pub fn show_header(&mut self, show: bool) -> Result<(), Error>

source

pub fn progress(&mut self, progress: bool) -> Result<(), Error>

Same as Easy2::progress

+
source

pub fn signal(&mut self, signal: bool) -> Result<(), Error>

Same as Easy2::signal

+
source

pub fn wildcard_match(&mut self, m: bool) -> Result<(), Error>

source

pub fn unix_socket(&mut self, unix_domain_socket: &str) -> Result<(), Error>

source

pub fn unix_socket_path<P: AsRef<Path>>( + &mut self, + path: Option<P> +) -> Result<(), Error>

source

pub fn abstract_unix_socket(&mut self, addr: &[u8]) -> Result<(), Error>

Same as Easy2::abstract_unix_socket

+

NOTE: this API can only be used on Linux OS.

+
source

pub fn write_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(&[u8]) -> Result<usize, WriteError> + Send + 'static,

Set callback for writing received data.

+

This callback function gets called by libcurl as soon as there is data +received that needs to be saved.

+

The callback function will be passed as much data as possible in all +invokes, but you must not make any assumptions. It may be one byte, it +may be thousands. If show_header is enabled, which makes header data +get passed to the write callback, you can get up to +CURL_MAX_HTTP_HEADER bytes of header data passed into it. This +usually means 100K.

+

This function may be called with zero bytes data if the transferred file +is empty.

+

The callback should return the number of bytes actually taken care of. +If that amount differs from the amount passed to your callback function, +it’ll signal an error condition to the library. This will cause the +transfer to get aborted and the libcurl function used will return +an error with is_write_error.

+

If your callback function returns Err(WriteError::Pause) it will cause +this transfer to become paused. See unpause_write for further details.

+

By default data is sent into the void, and this corresponds to the +CURLOPT_WRITEFUNCTION and CURLOPT_WRITEDATA options.

+

Note that the lifetime bound on this function is 'static, but that +is often too restrictive. To use stack data consider calling the +transfer method and then using write_function to configure a +callback that can reference stack-local data.

+
Examples
+
use std::io::{stdout, Write};
+use curl::easy::Easy;
+
+let mut handle = Easy::new();
+handle.url("https://www.rust-lang.org/").unwrap();
+handle.write_function(|data| {
+    Ok(stdout().write(data).unwrap())
+}).unwrap();
+handle.perform().unwrap();
+

Writing to a stack-local buffer

+ +
use std::io::{stdout, Write};
+use curl::easy::Easy;
+
+let mut buf = Vec::new();
+let mut handle = Easy::new();
+handle.url("https://www.rust-lang.org/").unwrap();
+
+let mut transfer = handle.transfer();
+transfer.write_function(|data| {
+    buf.extend_from_slice(data);
+    Ok(data.len())
+}).unwrap();
+transfer.perform().unwrap();
+
source

pub fn read_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(&mut [u8]) -> Result<usize, ReadError> + Send + 'static,

Read callback for data uploads.

+

This callback function gets called by libcurl as soon as it needs to +read data in order to send it to the peer - like if you ask it to upload +or post data to the server.

+

Your function must then return the actual number of bytes that it stored +in that memory area. Returning 0 will signal end-of-file to the library +and cause it to stop the current transfer.

+

If you stop the current transfer by returning 0 “pre-maturely” (i.e +before the server expected it, like when you’ve said you will upload N +bytes and you upload less than N bytes), you may experience that the +server “hangs” waiting for the rest of the data that won’t come.

+

The read callback may return Err(ReadError::Abort) to stop the +current operation immediately, resulting in a is_aborted_by_callback +error code from the transfer.

+

The callback can return Err(ReadError::Pause) to cause reading from +this connection to pause. See unpause_read for further details.

+

By default data not input, and this corresponds to the +CURLOPT_READFUNCTION and CURLOPT_READDATA options.

+

Note that the lifetime bound on this function is 'static, but that +is often too restrictive. To use stack data consider calling the +transfer method and then using read_function to configure a +callback that can reference stack-local data.

+
Examples
+

Read input from stdin

+ +
use std::io::{stdin, Read};
+use curl::easy::Easy;
+
+let mut handle = Easy::new();
+handle.url("https://example.com/login").unwrap();
+handle.read_function(|into| {
+    Ok(stdin().read(into).unwrap())
+}).unwrap();
+handle.post(true).unwrap();
+handle.perform().unwrap();
+

Reading from stack-local data:

+ +
use std::io::{stdin, Read};
+use curl::easy::Easy;
+
+let mut data_to_upload = &b"foobar"[..];
+let mut handle = Easy::new();
+handle.url("https://example.com/login").unwrap();
+handle.post(true).unwrap();
+
+let mut transfer = handle.transfer();
+transfer.read_function(|into| {
+    Ok(data_to_upload.read(into).unwrap())
+}).unwrap();
+transfer.perform().unwrap();
+
source

pub fn seek_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(SeekFrom) -> SeekResult + Send + 'static,

User callback for seeking in input stream.

+

This function gets called by libcurl to seek to a certain position in +the input stream and can be used to fast forward a file in a resumed +upload (instead of reading all uploaded bytes with the normal read +function/callback). It is also called to rewind a stream when data has +already been sent to the server and needs to be sent again. This may +happen when doing a HTTP PUT or POST with a multi-pass authentication +method, or when an existing HTTP connection is reused too late and the +server closes the connection.

+

The callback function must return SeekResult::Ok on success, +SeekResult::Fail to cause the upload operation to fail or +SeekResult::CantSeek to indicate that while the seek failed, libcurl +is free to work around the problem if possible. The latter can sometimes +be done by instead reading from the input or similar.

+

By default data this option is not set, and this corresponds to the +CURLOPT_SEEKFUNCTION and CURLOPT_SEEKDATA options.

+

Note that the lifetime bound on this function is 'static, but that +is often too restrictive. To use stack data consider calling the +transfer method and then using seek_function to configure a +callback that can reference stack-local data.

+
source

pub fn progress_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(f64, f64, f64, f64) -> bool + Send + 'static,

Callback to progress meter function

+

This function gets called by libcurl instead of its internal equivalent +with a frequent interval. While data is being transferred it will be +called very frequently, and during slow periods like when nothing is +being transferred it can slow down to about one call per second.

+

The callback gets told how much data libcurl will transfer and has +transferred, in number of bytes. The first argument is the total number +of bytes libcurl expects to download in this transfer. The second +argument is the number of bytes downloaded so far. The third argument is +the total number of bytes libcurl expects to upload in this transfer. +The fourth argument is the number of bytes uploaded so far.

+

Unknown/unused argument values passed to the callback will be set to +zero (like if you only download data, the upload size will remain 0). +Many times the callback will be called one or more times first, before +it knows the data sizes so a program must be made to handle that.

+

Returning false from this callback will cause libcurl to abort the +transfer and return is_aborted_by_callback.

+

If you transfer data with the multi interface, this function will not be +called during periods of idleness unless you call the appropriate +libcurl function that performs transfers.

+

progress must be set to true to make this function actually get +called.

+

By default this function calls an internal method and corresponds to +CURLOPT_PROGRESSFUNCTION and CURLOPT_PROGRESSDATA.

+

Note that the lifetime bound on this function is 'static, but that +is often too restrictive. To use stack data consider calling the +transfer method and then using progress_function to configure a +callback that can reference stack-local data.

+
source

pub fn ssl_ctx_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(*mut c_void) -> Result<(), Error> + Send + 'static,

Callback to SSL context

+

This callback function gets called by libcurl just before the +initialization of an SSL connection after having processed all +other SSL related options to give a last chance to an +application to modify the behaviour of the SSL +initialization. The ssl_ctx parameter is actually a pointer +to the SSL library’s SSL_CTX. If an error is returned from the +callback no attempt to establish a connection is made and the +perform operation will return the callback’s error code.

+

This function will get called on all new connections made to a +server, during the SSL negotiation. The SSL_CTX pointer will +be a new one every time.

+

To use this properly, a non-trivial amount of knowledge of +your SSL library is necessary. For example, you can use this +function to call library-specific callbacks to add additional +validation code for certificates, and even to change the +actual URI of a HTTPS request.

+

By default this function calls an internal method and +corresponds to CURLOPT_SSL_CTX_FUNCTION and +CURLOPT_SSL_CTX_DATA.

+

Note that the lifetime bound on this function is 'static, but that +is often too restrictive. To use stack data consider calling the +transfer method and then using progress_function to configure a +callback that can reference stack-local data.

+
source

pub fn debug_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(InfoType, &[u8]) + Send + 'static,

Specify a debug callback

+

debug_function replaces the standard debug function used when +verbose is in effect. This callback receives debug information, +as specified in the type argument.

+

By default this option is not set and corresponds to the +CURLOPT_DEBUGFUNCTION and CURLOPT_DEBUGDATA options.

+

Note that the lifetime bound on this function is 'static, but that +is often too restrictive. To use stack data consider calling the +transfer method and then using debug_function to configure a +callback that can reference stack-local data.

+
source

pub fn header_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(&[u8]) -> bool + Send + 'static,

Callback that receives header data

+

This function gets called by libcurl as soon as it has received header +data. The header callback will be called once for each header and only +complete header lines are passed on to the callback. Parsing headers is +very easy using this. If this callback returns false it’ll signal an +error to the library. This will cause the transfer to get aborted and +the libcurl function in progress will return is_write_error.

+

A complete HTTP header that is passed to this function can be up to +CURL_MAX_HTTP_HEADER (100K) bytes.

+

It’s important to note that the callback will be invoked for the headers +of all responses received after initiating a request and not just the +final response. This includes all responses which occur during +authentication negotiation. If you need to operate on only the headers +from the final response, you will need to collect headers in the +callback yourself and use HTTP status lines, for example, to delimit +response boundaries.

+

When a server sends a chunked encoded transfer, it may contain a +trailer. That trailer is identical to a HTTP header and if such a +trailer is received it is passed to the application using this callback +as well. There are several ways to detect it being a trailer and not an +ordinary header: 1) it comes after the response-body. 2) it comes after +the final header line (CR LF) 3) a Trailer: header among the regular +response-headers mention what header(s) to expect in the trailer.

+

For non-HTTP protocols like FTP, POP3, IMAP and SMTP this function will +get called with the server responses to the commands that libcurl sends.

+

By default this option is not set and corresponds to the +CURLOPT_HEADERFUNCTION and CURLOPT_HEADERDATA options.

+

Note that the lifetime bound on this function is 'static, but that +is often too restrictive. To use stack data consider calling the +transfer method and then using header_function to configure a +callback that can reference stack-local data.

+
Examples
+
use std::str;
+
+use curl::easy::Easy;
+
+let mut handle = Easy::new();
+handle.url("https://www.rust-lang.org/").unwrap();
+handle.header_function(|header| {
+    print!("header: {}", str::from_utf8(header).unwrap());
+    true
+}).unwrap();
+handle.perform().unwrap();
+

Collecting headers to a stack local vector

+ +
use std::str;
+
+use curl::easy::Easy;
+
+let mut headers = Vec::new();
+let mut handle = Easy::new();
+handle.url("https://www.rust-lang.org/").unwrap();
+
+{
+    let mut transfer = handle.transfer();
+    transfer.header_function(|header| {
+        headers.push(str::from_utf8(header).unwrap().to_string());
+        true
+    }).unwrap();
+    transfer.perform().unwrap();
+}
+
+println!("{:?}", headers);
+
source

pub fn fail_on_error(&mut self, fail: bool) -> Result<(), Error>

source

pub fn url(&mut self, url: &str) -> Result<(), Error>

Same as Easy2::url

+
source

pub fn port(&mut self, port: u16) -> Result<(), Error>

Same as Easy2::port

+
source

pub fn connect_to(&mut self, list: List) -> Result<(), Error>

source

pub fn path_as_is(&mut self, as_is: bool) -> Result<(), Error>

source

pub fn proxy(&mut self, url: &str) -> Result<(), Error>

Same as Easy2::proxy

+
source

pub fn proxy_port(&mut self, port: u16) -> Result<(), Error>

source

pub fn proxy_cainfo(&mut self, cainfo: &str) -> Result<(), Error>

source

pub fn proxy_capath<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>

source

pub fn proxy_sslcert(&mut self, sslcert: &str) -> Result<(), Error>

source

pub fn proxy_sslcert_type(&mut self, kind: &str) -> Result<(), Error>

source

pub fn proxy_sslcert_blob(&mut self, blob: &[u8]) -> Result<(), Error>

source

pub fn proxy_sslkey(&mut self, sslkey: &str) -> Result<(), Error>

source

pub fn proxy_sslkey_type(&mut self, kind: &str) -> Result<(), Error>

source

pub fn proxy_sslkey_blob(&mut self, blob: &[u8]) -> Result<(), Error>

source

pub fn proxy_key_password(&mut self, password: &str) -> Result<(), Error>

source

pub fn proxy_type(&mut self, kind: ProxyType) -> Result<(), Error>

source

pub fn noproxy(&mut self, skip: &str) -> Result<(), Error>

Same as Easy2::noproxy

+
source

pub fn http_proxy_tunnel(&mut self, tunnel: bool) -> Result<(), Error>

source

pub fn interface(&mut self, interface: &str) -> Result<(), Error>

source

pub fn set_local_port(&mut self, port: u16) -> Result<(), Error>

source

pub fn local_port_range(&mut self, range: u16) -> Result<(), Error>

source

pub fn dns_servers(&mut self, servers: &str) -> Result<(), Error>

source

pub fn dns_cache_timeout(&mut self, dur: Duration) -> Result<(), Error>

source

pub fn doh_url(&mut self, url: Option<&str>) -> Result<(), Error>

Same as Easy2::doh_url

+
source

pub fn doh_ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error>

source

pub fn doh_ssl_verify_host(&mut self, verify: bool) -> Result<(), Error>

source

pub fn doh_ssl_verify_status(&mut self, verify: bool) -> Result<(), Error>

source

pub fn buffer_size(&mut self, size: usize) -> Result<(), Error>

source

pub fn upload_buffer_size(&mut self, size: usize) -> Result<(), Error>

source

pub fn tcp_nodelay(&mut self, enable: bool) -> Result<(), Error>

source

pub fn tcp_keepalive(&mut self, enable: bool) -> Result<(), Error>

source

pub fn tcp_keepintvl(&mut self, dur: Duration) -> Result<(), Error>

source

pub fn tcp_keepidle(&mut self, dur: Duration) -> Result<(), Error>

source

pub fn address_scope(&mut self, scope: u32) -> Result<(), Error>

source

pub fn username(&mut self, user: &str) -> Result<(), Error>

Same as Easy2::username

+
source

pub fn password(&mut self, pass: &str) -> Result<(), Error>

Same as Easy2::password

+
source

pub fn http_auth(&mut self, auth: &Auth) -> Result<(), Error>

source

pub fn aws_sigv4(&mut self, param: &str) -> Result<(), Error>

source

pub fn proxy_username(&mut self, user: &str) -> Result<(), Error>

source

pub fn proxy_password(&mut self, pass: &str) -> Result<(), Error>

source

pub fn proxy_auth(&mut self, auth: &Auth) -> Result<(), Error>

source

pub fn netrc(&mut self, netrc: NetRc) -> Result<(), Error>

Same as Easy2::netrc

+
source

pub fn autoreferer(&mut self, enable: bool) -> Result<(), Error>

source

pub fn accept_encoding(&mut self, encoding: &str) -> Result<(), Error>

source

pub fn transfer_encoding(&mut self, enable: bool) -> Result<(), Error>

source

pub fn follow_location(&mut self, enable: bool) -> Result<(), Error>

source

pub fn unrestricted_auth(&mut self, enable: bool) -> Result<(), Error>

source

pub fn max_redirections(&mut self, max: u32) -> Result<(), Error>

source

pub fn post_redirections( + &mut self, + redirects: &PostRedirections +) -> Result<(), Error>

source

pub fn put(&mut self, enable: bool) -> Result<(), Error>

Same as Easy2::put

+
source

pub fn post(&mut self, enable: bool) -> Result<(), Error>

Same as Easy2::post

+
source

pub fn post_fields_copy(&mut self, data: &[u8]) -> Result<(), Error>

source

pub fn post_field_size(&mut self, size: u64) -> Result<(), Error>

source

pub fn httppost(&mut self, form: Form) -> Result<(), Error>

Same as Easy2::httppost

+
source

pub fn referer(&mut self, referer: &str) -> Result<(), Error>

Same as Easy2::referer

+
source

pub fn useragent(&mut self, useragent: &str) -> Result<(), Error>

source

pub fn http_headers(&mut self, list: List) -> Result<(), Error>

source

pub fn cookie(&mut self, cookie: &str) -> Result<(), Error>

Same as Easy2::cookie

+
source

pub fn cookie_file<P: AsRef<Path>>(&mut self, file: P) -> Result<(), Error>

source

pub fn cookie_jar<P: AsRef<Path>>(&mut self, file: P) -> Result<(), Error>

source

pub fn cookie_session(&mut self, session: bool) -> Result<(), Error>

source

pub fn cookie_list(&mut self, cookie: &str) -> Result<(), Error>

source

pub fn get(&mut self, enable: bool) -> Result<(), Error>

Same as Easy2::get

+
source

pub fn ignore_content_length(&mut self, ignore: bool) -> Result<(), Error>

source

pub fn http_content_decoding(&mut self, enable: bool) -> Result<(), Error>

source

pub fn http_transfer_decoding(&mut self, enable: bool) -> Result<(), Error>

source

pub fn range(&mut self, range: &str) -> Result<(), Error>

Same as Easy2::range

+
source

pub fn resume_from(&mut self, from: u64) -> Result<(), Error>

source

pub fn custom_request(&mut self, request: &str) -> Result<(), Error>

source

pub fn fetch_filetime(&mut self, fetch: bool) -> Result<(), Error>

source

pub fn nobody(&mut self, enable: bool) -> Result<(), Error>

Same as Easy2::nobody

+
source

pub fn in_filesize(&mut self, size: u64) -> Result<(), Error>

source

pub fn upload(&mut self, enable: bool) -> Result<(), Error>

Same as Easy2::upload

+
source

pub fn max_filesize(&mut self, size: u64) -> Result<(), Error>

source

pub fn time_condition(&mut self, cond: TimeCondition) -> Result<(), Error>

source

pub fn time_value(&mut self, val: i64) -> Result<(), Error>

source

pub fn timeout(&mut self, timeout: Duration) -> Result<(), Error>

Same as Easy2::timeout

+
source

pub fn low_speed_limit(&mut self, limit: u32) -> Result<(), Error>

source

pub fn low_speed_time(&mut self, dur: Duration) -> Result<(), Error>

source

pub fn max_send_speed(&mut self, speed: u64) -> Result<(), Error>

source

pub fn max_recv_speed(&mut self, speed: u64) -> Result<(), Error>

source

pub fn max_connects(&mut self, max: u32) -> Result<(), Error>

source

pub fn maxage_conn(&mut self, max_age: Duration) -> Result<(), Error>

source

pub fn fresh_connect(&mut self, enable: bool) -> Result<(), Error>

source

pub fn forbid_reuse(&mut self, enable: bool) -> Result<(), Error>

source

pub fn connect_timeout(&mut self, timeout: Duration) -> Result<(), Error>

source

pub fn ip_resolve(&mut self, resolve: IpResolve) -> Result<(), Error>

source

pub fn resolve(&mut self, list: List) -> Result<(), Error>

Same as Easy2::resolve

+
source

pub fn connect_only(&mut self, enable: bool) -> Result<(), Error>

source

pub fn ssl_cert<P: AsRef<Path>>(&mut self, cert: P) -> Result<(), Error>

Same as Easy2::ssl_cert

+
source

pub fn ssl_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error>

source

pub fn ssl_cert_type(&mut self, kind: &str) -> Result<(), Error>

source

pub fn ssl_key<P: AsRef<Path>>(&mut self, key: P) -> Result<(), Error>

Same as Easy2::ssl_key

+
source

pub fn ssl_key_blob(&mut self, blob: &[u8]) -> Result<(), Error>

source

pub fn ssl_key_type(&mut self, kind: &str) -> Result<(), Error>

source

pub fn key_password(&mut self, password: &str) -> Result<(), Error>

source

pub fn ssl_cainfo_blob(&mut self, blob: &[u8]) -> Result<(), Error>

source

pub fn proxy_ssl_cainfo_blob(&mut self, blob: &[u8]) -> Result<(), Error>

source

pub fn ssl_engine(&mut self, engine: &str) -> Result<(), Error>

source

pub fn ssl_engine_default(&mut self, enable: bool) -> Result<(), Error>

source

pub fn http_version(&mut self, version: HttpVersion) -> Result<(), Error>

source

pub fn ssl_version(&mut self, version: SslVersion) -> Result<(), Error>

source

pub fn proxy_ssl_version(&mut self, version: SslVersion) -> Result<(), Error>

source

pub fn ssl_min_max_version( + &mut self, + min_version: SslVersion, + max_version: SslVersion +) -> Result<(), Error>

source

pub fn proxy_ssl_min_max_version( + &mut self, + min_version: SslVersion, + max_version: SslVersion +) -> Result<(), Error>

source

pub fn ssl_verify_host(&mut self, verify: bool) -> Result<(), Error>

source

pub fn proxy_ssl_verify_host(&mut self, verify: bool) -> Result<(), Error>

source

pub fn ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error>

source

pub fn proxy_ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error>

source

pub fn cainfo<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>

Same as Easy2::cainfo

+
source

pub fn issuer_cert<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>

source

pub fn proxy_issuer_cert<P: AsRef<Path>>( + &mut self, + path: P +) -> Result<(), Error>

source

pub fn issuer_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error>

source

pub fn proxy_issuer_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error>

source

pub fn capath<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>

Same as Easy2::capath

+
source

pub fn crlfile<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>

Same as Easy2::crlfile

+
source

pub fn proxy_crlfile<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>

source

pub fn certinfo(&mut self, enable: bool) -> Result<(), Error>

Same as Easy2::certinfo

+
source

pub fn random_file<P: AsRef<Path>>(&mut self, p: P) -> Result<(), Error>

source

pub fn egd_socket<P: AsRef<Path>>(&mut self, p: P) -> Result<(), Error>

source

pub fn ssl_cipher_list(&mut self, ciphers: &str) -> Result<(), Error>

source

pub fn proxy_ssl_cipher_list(&mut self, ciphers: &str) -> Result<(), Error>

source

pub fn ssl_sessionid_cache(&mut self, enable: bool) -> Result<(), Error>

source

pub fn ssl_options(&mut self, bits: &SslOpt) -> Result<(), Error>

source

pub fn proxy_ssl_options(&mut self, bits: &SslOpt) -> Result<(), Error>

source

pub fn pinned_public_key(&mut self, pubkey: &str) -> Result<(), Error>

source

pub fn time_condition_unmet(&mut self) -> Result<bool, Error>

source

pub fn effective_url(&mut self) -> Result<Option<&str>, Error>

source

pub fn effective_url_bytes(&mut self) -> Result<Option<&[u8]>, Error>

source

pub fn response_code(&mut self) -> Result<u32, Error>

source

pub fn http_connectcode(&mut self) -> Result<u32, Error>

source

pub fn filetime(&mut self) -> Result<Option<i64>, Error>

Same as Easy2::filetime

+
source

pub fn download_size(&mut self) -> Result<f64, Error>

source

pub fn upload_size(&mut self) -> Result<f64, Error>

source

pub fn content_length_download(&mut self) -> Result<f64, Error>

source

pub fn total_time(&mut self) -> Result<Duration, Error>

source

pub fn namelookup_time(&mut self) -> Result<Duration, Error>

source

pub fn connect_time(&mut self) -> Result<Duration, Error>

source

pub fn appconnect_time(&mut self) -> Result<Duration, Error>

source

pub fn pretransfer_time(&mut self) -> Result<Duration, Error>

source

pub fn starttransfer_time(&mut self) -> Result<Duration, Error>

source

pub fn redirect_time(&mut self) -> Result<Duration, Error>

source

pub fn redirect_count(&mut self) -> Result<u32, Error>

source

pub fn redirect_url(&mut self) -> Result<Option<&str>, Error>

source

pub fn redirect_url_bytes(&mut self) -> Result<Option<&[u8]>, Error>

source

pub fn header_size(&mut self) -> Result<u64, Error>

source

pub fn request_size(&mut self) -> Result<u64, Error>

source

pub fn content_type(&mut self) -> Result<Option<&str>, Error>

source

pub fn content_type_bytes(&mut self) -> Result<Option<&[u8]>, Error>

source

pub fn os_errno(&mut self) -> Result<i32, Error>

Same as Easy2::os_errno

+
source

pub fn primary_ip(&mut self) -> Result<Option<&str>, Error>

source

pub fn primary_port(&mut self) -> Result<u16, Error>

source

pub fn local_ip(&mut self) -> Result<Option<&str>, Error>

Same as Easy2::local_ip

+
source

pub fn local_port(&mut self) -> Result<u16, Error>

source

pub fn cookies(&mut self) -> Result<List, Error>

Same as Easy2::cookies

+
source

pub fn pipewait(&mut self, wait: bool) -> Result<(), Error>

Same as Easy2::pipewait

+
source

pub fn http_09_allowed(&mut self, allow: bool) -> Result<(), Error>

source

pub fn perform(&self) -> Result<(), Error>

Same as Easy2::perform

+
source

pub fn transfer<'data, 'easy>(&'easy mut self) -> Transfer<'easy, 'data>

Creates a new scoped transfer which can be used to set callbacks and +data which only live for the scope of the returned object.

+

An Easy handle is often reused between different requests to cache +connections to servers, but often the lifetime of the data as part of +each transfer is unique. This function serves as an ability to share an +Easy across many transfers while ergonomically using possibly +stack-local data as part of each transfer.

+

Configuration can be set on the Easy and then a Transfer can be +created to set scoped configuration (like callbacks). Finally, the +perform method on the Transfer function can be used.

+

When the Transfer option is dropped then all configuration set on the +transfer itself will be reset.

+
source

pub fn upkeep(&self) -> Result<(), Error>

Same as Easy2::upkeep

+
source

pub fn unpause_read(&self) -> Result<(), Error>

source

pub fn unpause_write(&self) -> Result<(), Error>

source

pub fn url_encode(&mut self, s: &[u8]) -> String

source

pub fn url_decode(&mut self, s: &str) -> Vec<u8>

source

pub fn reset(&mut self)

Same as Easy2::reset

+
source

pub fn recv(&mut self, data: &mut [u8]) -> Result<usize, Error>

Same as Easy2::recv

+
source

pub fn send(&mut self, data: &[u8]) -> Result<usize, Error>

Same as Easy2::send

+
source

pub fn raw(&self) -> *mut CURL

Same as Easy2::raw

+
source

pub fn take_error_buf(&self) -> Option<String>

Trait Implementations§

source§

impl Debug for Easy

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Easy

§

impl Send for Easy

§

impl !Sync for Easy

§

impl Unpin for Easy

§

impl !UnwindSafe for Easy

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, 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.
\ No newline at end of file diff --git a/curl/easy/struct.Easy2.html b/curl/easy/struct.Easy2.html new file mode 100644 index 000000000..99e81185b --- /dev/null +++ b/curl/easy/struct.Easy2.html @@ -0,0 +1,1236 @@ +Easy2 in curl::easy - Rust +

Struct curl::easy::Easy2

source ·
pub struct Easy2<H> { /* private fields */ }
Expand description

Raw bindings to a libcurl “easy session”.

+

This type corresponds to the CURL type in libcurl, and is probably what +you want for just sending off a simple HTTP request and fetching a response. +Each easy handle can be thought of as a large builder before calling the +final perform function.

+

There are many many configuration options for each Easy2 handle, and they +should all have their own documentation indicating what it affects and how +it interacts with other options. Some implementations of libcurl can use +this handle to interact with many different protocols, although by default +this crate only guarantees the HTTP/HTTPS protocols working.

+

Note that almost all methods on this structure which configure various +properties return a Result. This is largely used to detect whether the +underlying implementation of libcurl actually implements the option being +requested. If you’re linked to a version of libcurl which doesn’t support +the option, then an error will be returned. Some options also perform some +validation when they’re set, and the error is returned through this vector.

+

Note that historically this library contained an Easy handle so this one’s +called Easy2. The major difference between the Easy type is that an +Easy2 structure uses a trait instead of closures for all of the callbacks +that curl can invoke. The Easy type is actually built on top of this +Easy type, and this Easy2 type can be more flexible in some situations +due to the generic parameter.

+

There’s not necessarily a right answer for which type is correct to use, but +as a general rule of thumb Easy is typically a reasonable choice for +synchronous I/O and Easy2 is a good choice for asynchronous I/O.

+

Examples

+
use curl::easy::{Easy2, Handler, WriteError};
+
+struct Collector(Vec<u8>);
+
+impl Handler for Collector {
+    fn write(&mut self, data: &[u8]) -> Result<usize, WriteError> {
+        self.0.extend_from_slice(data);
+        Ok(data.len())
+    }
+}
+
+let mut easy = Easy2::new(Collector(Vec::new()));
+easy.get(true).unwrap();
+easy.url("https://www.rust-lang.org/").unwrap();
+easy.perform().unwrap();
+
+assert_eq!(easy.response_code().unwrap(), 200);
+let contents = easy.get_ref();
+println!("{}", String::from_utf8_lossy(&contents.0));
+

Implementations§

source§

impl<H: Handler> Easy2<H>

source

pub fn new(handler: H) -> Easy2<H>

Creates a new “easy” handle which is the core of almost all operations +in libcurl.

+

To use a handle, applications typically configure a number of options +followed by a call to perform. Options are preserved across calls to +perform and need to be reset manually (or via the reset method) if +this is not desired.

+
source

pub fn reset(&mut self)

Re-initializes this handle to the default values.

+

This puts the handle to the same state as it was in when it was just +created. This does, however, keep live connections, the session id +cache, the dns cache, and cookies.

+
source§

impl<H> Easy2<H>

source

pub fn verbose(&mut self, verbose: bool) -> Result<(), Error>

Configures this handle to have verbose output to help debug protocol +information.

+

By default output goes to stderr, but the stderr function on this type +can configure that. You can also use the debug_function method to get +all protocol data sent and received.

+

By default, this option is false.

+
source

pub fn show_header(&mut self, show: bool) -> Result<(), Error>

Indicates whether header information is streamed to the output body of +this request.

+

This option is only relevant for protocols which have header metadata +(like http or ftp). It’s not generally possible to extract headers +from the body if using this method, that use case should be intended for +the header_function method.

+

To set HTTP headers, use the http_header method.

+

By default, this option is false and corresponds to +CURLOPT_HEADER.

+
source

pub fn progress(&mut self, progress: bool) -> Result<(), Error>

Indicates whether a progress meter will be shown for requests done with +this handle.

+

This will also prevent the progress_function from being called.

+

By default this option is false and corresponds to +CURLOPT_NOPROGRESS.

+
source

pub fn signal(&mut self, signal: bool) -> Result<(), Error>

Inform libcurl whether or not it should install signal handlers or +attempt to use signals to perform library functions.

+

If this option is disabled then timeouts during name resolution will not +work unless libcurl is built against c-ares. Note that enabling this +option, however, may not cause libcurl to work with multiple threads.

+

By default this option is false and corresponds to CURLOPT_NOSIGNAL. +Note that this default is different than libcurl as it is intended +that this library is threadsafe by default. See the libcurl docs for +some more information.

+
source

pub fn wildcard_match(&mut self, m: bool) -> Result<(), Error>

Indicates whether multiple files will be transferred based on the file +name pattern.

+

The last part of a filename uses fnmatch-like pattern matching.

+

By default this option is false and corresponds to +CURLOPT_WILDCARDMATCH.

+
source

pub fn unix_socket(&mut self, unix_domain_socket: &str) -> Result<(), Error>

Provides the Unix domain socket which this handle will work with.

+

The string provided must be a path to a Unix domain socket encoded with +the format:

+
/path/file.sock
+
+

By default this option is not set and corresponds to +CURLOPT_UNIX_SOCKET_PATH.

+
source

pub fn unix_socket_path<P: AsRef<Path>>( + &mut self, + path: Option<P> +) -> Result<(), Error>

Provides the Unix domain socket which this handle will work with.

+

The string provided must be a path to a Unix domain socket encoded with +the format:

+
/path/file.sock
+
+

This function is an alternative to Easy2::unix_socket that supports +non-UTF-8 paths and also supports disabling Unix sockets by setting the +option to None.

+

By default this option is not set and corresponds to +CURLOPT_UNIX_SOCKET_PATH.

+
source

pub fn abstract_unix_socket(&mut self, addr: &[u8]) -> Result<(), Error>

Provides the ABSTRACT UNIX SOCKET which this handle will work with.

+

This function is an alternative to Easy2::unix_socket and Easy2::unix_socket_path that supports +ABSTRACT_UNIX_SOCKET(man 7 unix on Linux) address.

+

By default this option is not set and corresponds to +CURLOPT_ABSTRACT_UNIX_SOCKET.

+

NOTE: this API can only be used on Linux OS.

+
source

pub fn get_ref(&self) -> &H

Acquires a reference to the underlying handler for events.

+
source

pub fn get_mut(&mut self) -> &mut H

Acquires a reference to the underlying handler for events.

+
source

pub fn fail_on_error(&mut self, fail: bool) -> Result<(), Error>

Indicates whether this library will fail on HTTP response codes >= 400.

+

This method is not fail-safe especially when authentication is involved.

+

By default this option is false and corresponds to +CURLOPT_FAILONERROR.

+
source

pub fn url(&mut self, url: &str) -> Result<(), Error>

Provides the URL which this handle will work with.

+

The string provided must be URL-encoded with the format:

+
scheme://host:port/path
+
+

The syntax is not validated as part of this function and that is +deferred until later.

+

By default this option is not set and perform will not work until it +is set. This option corresponds to CURLOPT_URL.

+
source

pub fn port(&mut self, port: u16) -> Result<(), Error>

Configures the port number to connect to, instead of the one specified +in the URL or the default of the protocol.

+
source

pub fn connect_to(&mut self, list: List) -> Result<(), Error>

Connect to a specific host and port.

+

Each single string should be written using the format +HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT where HOST is the host of +the request, PORT is the port of the request, CONNECT-TO-HOST is the +host name to connect to, and CONNECT-TO-PORT is the port to connect +to.

+

The first string that matches the request’s host and port is used.

+

By default, this option is empty and corresponds to +CURLOPT_CONNECT_TO.

+
source

pub fn path_as_is(&mut self, as_is: bool) -> Result<(), Error>

Indicates whether sequences of /../ and /./ will be squashed or not.

+

By default this option is false and corresponds to +CURLOPT_PATH_AS_IS.

+
source

pub fn proxy(&mut self, url: &str) -> Result<(), Error>

Provide the URL of a proxy to use.

+

By default this option is not set and corresponds to CURLOPT_PROXY.

+
source

pub fn proxy_port(&mut self, port: u16) -> Result<(), Error>

Provide port number the proxy is listening on.

+

By default this option is not set (the default port for the proxy +protocol is used) and corresponds to CURLOPT_PROXYPORT.

+
source

pub fn proxy_cainfo(&mut self, cainfo: &str) -> Result<(), Error>

Set CA certificate to verify peer against for proxy.

+

By default this value is not set and corresponds to +CURLOPT_PROXY_CAINFO.

+
source

pub fn proxy_capath<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>

Specify a directory holding CA certificates for proxy.

+

The specified directory should hold multiple CA certificates to verify +the HTTPS proxy with. If libcurl is built against OpenSSL, the +certificate directory must be prepared using the OpenSSL c_rehash +utility.

+

By default this value is not set and corresponds to +CURLOPT_PROXY_CAPATH.

+
source

pub fn proxy_sslcert(&mut self, sslcert: &str) -> Result<(), Error>

Set client certificate for proxy.

+

By default this value is not set and corresponds to +CURLOPT_PROXY_SSLCERT.

+
source

pub fn proxy_sslcert_type(&mut self, kind: &str) -> Result<(), Error>

Specify type of the client SSL certificate for HTTPS proxy.

+

The string should be the format of your certificate. Supported formats +are “PEM” and “DER”, except with Secure Transport. OpenSSL (versions +0.9.3 and later) and Secure Transport (on iOS 5 or later, or OS X 10.7 +or later) also support “P12” for PKCS#12-encoded files.

+

By default this option is “PEM” and corresponds to +CURLOPT_PROXY_SSLCERTTYPE.

+
source

pub fn proxy_sslcert_blob(&mut self, blob: &[u8]) -> Result<(), Error>

Set the client certificate for the proxy using an in-memory blob.

+

The specified byte buffer should contain the binary content of the +certificate, which will be copied into the handle.

+

By default this option is not set and corresponds to +CURLOPT_PROXY_SSLCERT_BLOB.

+
source

pub fn proxy_sslkey(&mut self, sslkey: &str) -> Result<(), Error>

Set private key for HTTPS proxy.

+

By default this value is not set and corresponds to +CURLOPT_PROXY_SSLKEY.

+
source

pub fn proxy_sslkey_type(&mut self, kind: &str) -> Result<(), Error>

Set type of the private key file for HTTPS proxy.

+

The string should be the format of your private key. Supported formats +are “PEM”, “DER” and “ENG”.

+

The format “ENG” enables you to load the private key from a crypto +engine. In this case ssl_key is used as an identifier passed to +the engine. You have to set the crypto engine with ssl_engine. +“DER” format key file currently does not work because of a bug in +OpenSSL.

+

By default this option is “PEM” and corresponds to +CURLOPT_PROXY_SSLKEYTYPE.

+
source

pub fn proxy_sslkey_blob(&mut self, blob: &[u8]) -> Result<(), Error>

Set the private key for the proxy using an in-memory blob.

+

The specified byte buffer should contain the binary content of the +private key, which will be copied into the handle.

+

By default this option is not set and corresponds to +CURLOPT_PROXY_SSLKEY_BLOB.

+
source

pub fn proxy_key_password(&mut self, password: &str) -> Result<(), Error>

Set passphrase to private key for HTTPS proxy.

+

This will be used as the password required to use the ssl_key. +You never needed a pass phrase to load a certificate but you need one to +load your private key.

+

By default this option is not set and corresponds to +CURLOPT_PROXY_KEYPASSWD.

+
source

pub fn proxy_type(&mut self, kind: ProxyType) -> Result<(), Error>

Indicates the type of proxy being used.

+

By default this option is ProxyType::Http and corresponds to +CURLOPT_PROXYTYPE.

+
source

pub fn noproxy(&mut self, skip: &str) -> Result<(), Error>

Provide a list of hosts that should not be proxied to.

+

This string is a comma-separated list of hosts which should not use the +proxy specified for connections. A single * character is also accepted +as a wildcard for all hosts.

+

By default this option is not set and corresponds to +CURLOPT_NOPROXY.

+
source

pub fn http_proxy_tunnel(&mut self, tunnel: bool) -> Result<(), Error>

Inform curl whether it should tunnel all operations through the proxy.

+

This essentially means that a CONNECT is sent to the proxy for all +outbound requests.

+

By default this option is false and corresponds to +CURLOPT_HTTPPROXYTUNNEL.

+
source

pub fn interface(&mut self, interface: &str) -> Result<(), Error>

Tell curl which interface to bind to for an outgoing network interface.

+

The interface name, IP address, or host name can be specified here.

+

By default this option is not set and corresponds to +CURLOPT_INTERFACE.

+
source

pub fn set_local_port(&mut self, port: u16) -> Result<(), Error>

Indicate which port should be bound to locally for this connection.

+

By default this option is 0 (any port) and corresponds to +CURLOPT_LOCALPORT.

+
source

pub fn local_port_range(&mut self, range: u16) -> Result<(), Error>

Indicates the number of attempts libcurl will perform to find a working +port number.

+

By default this option is 1 and corresponds to +CURLOPT_LOCALPORTRANGE.

+
source

pub fn dns_servers(&mut self, servers: &str) -> Result<(), Error>

Sets the DNS servers that wil be used.

+

Provide a comma separated list, for example: 8.8.8.8,8.8.4.4.

+

By default this option is not set and the OS’s DNS resolver is used. +This option can only be used if libcurl is linked against +c-ares, otherwise setting it will return +an error.

+
source

pub fn dns_cache_timeout(&mut self, dur: Duration) -> Result<(), Error>

Sets the timeout of how long name resolves will be kept in memory.

+

This is distinct from DNS TTL options and is entirely speculative.

+

By default this option is 60s and corresponds to +CURLOPT_DNS_CACHE_TIMEOUT.

+
source

pub fn doh_url(&mut self, url: Option<&str>) -> Result<(), Error>

Provide the DNS-over-HTTPS URL.

+

The parameter must be URL-encoded in the following format: +https://host:port/path. It must specify a HTTPS URL.

+

libcurl does not validate the syntax or use this variable until the +transfer is issued. Even if you set a crazy value here, this method will +still return Ok.

+

curl sends POST requests to the given DNS-over-HTTPS URL.

+

To find the DoH server itself, which might be specified using a name, +libcurl will use the default name lookup function. You can bootstrap +that by providing the address for the DoH server with +Easy2::resolve.

+

Disable DoH use again by setting this option to None.

+

By default this option is not set and corresponds to CURLOPT_DOH_URL.

+
source

pub fn doh_ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error>

This option tells curl to verify the authenticity of the DoH +(DNS-over-HTTPS) server’s certificate. A value of true means curl +verifies; false means it does not.

+

This option is the DoH equivalent of Easy2::ssl_verify_peer and only +affects requests to the DoH server.

+

When negotiating a TLS or SSL connection, the server sends a certificate +indicating its identity. Curl verifies whether the certificate is +authentic, i.e. that you can trust that the server is who the +certificate says it is. This trust is based on a chain of digital +signatures, rooted in certification authority (CA) certificates you +supply. curl uses a default bundle of CA certificates (the path for that +is determined at build time) and you can specify alternate certificates +with the Easy2::cainfo option or the Easy2::capath option.

+

When doh_ssl_verify_peer is enabled, and the verification fails to +prove that the certificate is authentic, the connection fails. When the +option is zero, the peer certificate verification succeeds regardless.

+

Authenticating the certificate is not enough to be sure about the +server. You typically also want to ensure that the server is the server +you mean to be talking to. Use Easy2::doh_ssl_verify_host for that. +The check that the host name in the certificate is valid for the host +name you are connecting to is done independently of the +doh_ssl_verify_peer option.

+

WARNING: disabling verification of the certificate allows bad guys +to man-in-the-middle the communication without you knowing it. Disabling +verification makes the communication insecure. Just having encryption on +a transfer is not enough as you cannot be sure that you are +communicating with the correct end-point.

+

By default this option is set to true and corresponds to +CURLOPT_DOH_SSL_VERIFYPEER.

+
source

pub fn doh_ssl_verify_host(&mut self, verify: bool) -> Result<(), Error>

Tells curl to verify the DoH (DNS-over-HTTPS) server’s certificate name +fields against the host name.

+

This option is the DoH equivalent of Easy2::ssl_verify_host and only +affects requests to the DoH server.

+

When doh_ssl_verify_host is true, the SSL certificate provided by +the DoH server must indicate that the server name is the same as the +server name to which you meant to connect to, or the connection fails.

+

Curl considers the DoH server the intended one when the Common Name +field or a Subject Alternate Name field in the certificate matches the +host name in the DoH URL to which you told Curl to connect.

+

When the verify value is set to false, the connection succeeds +regardless of the names used in the certificate. Use that ability with +caution!

+

See also Easy2::doh_ssl_verify_peer to verify the digital signature +of the DoH server certificate. If libcurl is built against NSS and +Easy2::doh_ssl_verify_peer is false, doh_ssl_verify_host is also +set to false and cannot be overridden.

+

By default this option is set to true and corresponds to +CURLOPT_DOH_SSL_VERIFYHOST.

+
source

pub fn doh_ssl_verify_status(&mut self, verify: bool) -> Result<(), Error>

Pass a long as parameter set to 1 to enable or 0 to disable.

+

This option determines whether libcurl verifies the status of the DoH +(DNS-over-HTTPS) server cert using the “Certificate Status Request” TLS +extension (aka. OCSP stapling).

+

This option is the DoH equivalent of CURLOPT_SSL_VERIFYSTATUS and only +affects requests to the DoH server.

+

Note that if this option is enabled but the server does not support the +TLS extension, the verification will fail.

+

By default this option is set to false and corresponds to +CURLOPT_DOH_SSL_VERIFYSTATUS.

+
source

pub fn buffer_size(&mut self, size: usize) -> Result<(), Error>

Specify the preferred receive buffer size, in bytes.

+

This is treated as a request, not an order, and the main point of this +is that the write callback may get called more often with smaller +chunks.

+

By default this option is the maximum write size and corresopnds to +CURLOPT_BUFFERSIZE.

+
source

pub fn upload_buffer_size(&mut self, size: usize) -> Result<(), Error>

Specify the preferred send buffer size, in bytes.

+

This is treated as a request, not an order, and the main point of this +is that the read callback may get called more often with smaller +chunks.

+

The upload buffer size is by default 64 kilobytes.

+
source

pub fn tcp_nodelay(&mut self, enable: bool) -> Result<(), Error>

Configures whether the TCP_NODELAY option is set, or Nagle’s algorithm +is disabled.

+

The purpose of Nagle’s algorithm is to minimize the number of small +packet’s on the network, and disabling this may be less efficient in +some situations.

+

By default this option is false and corresponds to +CURLOPT_TCP_NODELAY.

+
source

pub fn tcp_keepalive(&mut self, enable: bool) -> Result<(), Error>

Configures whether TCP keepalive probes will be sent.

+

The delay and frequency of these probes is controlled by tcp_keepidle +and tcp_keepintvl.

+

By default this option is false and corresponds to +CURLOPT_TCP_KEEPALIVE.

+
source

pub fn tcp_keepidle(&mut self, amt: Duration) -> Result<(), Error>

Configures the TCP keepalive idle time wait.

+

This is the delay, after which the connection is idle, keepalive probes +will be sent. Not all operating systems support this.

+

By default this corresponds to CURLOPT_TCP_KEEPIDLE.

+
source

pub fn tcp_keepintvl(&mut self, amt: Duration) -> Result<(), Error>

Configures the delay between keepalive probes.

+

By default this corresponds to CURLOPT_TCP_KEEPINTVL.

+
source

pub fn address_scope(&mut self, scope: u32) -> Result<(), Error>

Configures the scope for local IPv6 addresses.

+

Sets the scope_id value to use when connecting to IPv6 or link-local +addresses.

+

By default this value is 0 and corresponds to CURLOPT_ADDRESS_SCOPE

+
source

pub fn username(&mut self, user: &str) -> Result<(), Error>

Configures the username to pass as authentication for this connection.

+

By default this value is not set and corresponds to CURLOPT_USERNAME.

+
source

pub fn password(&mut self, pass: &str) -> Result<(), Error>

Configures the password to pass as authentication for this connection.

+

By default this value is not set and corresponds to CURLOPT_PASSWORD.

+
source

pub fn http_auth(&mut self, auth: &Auth) -> Result<(), Error>

Set HTTP server authentication methods to try

+

If more than one method is set, libcurl will first query the site to see +which authentication methods it supports and then pick the best one you +allow it to use. For some methods, this will induce an extra network +round-trip. Set the actual name and password with the password and +username methods.

+

For authentication with a proxy, see proxy_auth.

+

By default this value is basic and corresponds to CURLOPT_HTTPAUTH.

+
source

pub fn aws_sigv4(&mut self, param: &str) -> Result<(), Error>

Provides AWS V4 signature authentication on HTTP(S) header.

+

param is used to create outgoing authentication headers. +Its format is provider1[:provider2[:region[:service]]]. +provider1,\ provider2" are used for generating auth parameters +such as “Algorithm”, “date”, “request type” and “signed headers”. +region is the geographic area of a resources collection. It is +extracted from the host name specified in the URL if omitted. +service is a function provided by a cloud. It is extracted +from the host name specified in the URL if omitted.

+

Example with “Test:Try”, when curl will do the algorithm, it will +generate “TEST-HMAC-SHA256” for “Algorithm”, “x-try-date” and +“X-Try-Date” for “date”, “test4_request” for “request type”, and +“SignedHeaders=content-type;host;x-try-date” for “signed headers”. +If you use just “test”, instead of “test:try”, test will be use +for every strings generated.

+

This is a special auth type that can’t be combined with the others. +It will override the other auth types you might have set.

+

By default this is not set and corresponds to CURLOPT_AWS_SIGV4.

+
source

pub fn proxy_username(&mut self, user: &str) -> Result<(), Error>

Configures the proxy username to pass as authentication for this +connection.

+

By default this value is not set and corresponds to +CURLOPT_PROXYUSERNAME.

+
source

pub fn proxy_password(&mut self, pass: &str) -> Result<(), Error>

Configures the proxy password to pass as authentication for this +connection.

+

By default this value is not set and corresponds to +CURLOPT_PROXYPASSWORD.

+
source

pub fn proxy_auth(&mut self, auth: &Auth) -> Result<(), Error>

Set HTTP proxy authentication methods to try

+

If more than one method is set, libcurl will first query the site to see +which authentication methods it supports and then pick the best one you +allow it to use. For some methods, this will induce an extra network +round-trip. Set the actual name and password with the proxy_password +and proxy_username methods.

+

By default this value is basic and corresponds to CURLOPT_PROXYAUTH.

+
source

pub fn netrc(&mut self, netrc: NetRc) -> Result<(), Error>

Enable .netrc parsing

+

By default the .netrc file is ignored and corresponds to CURL_NETRC_IGNORED.

+
source

pub fn autoreferer(&mut self, enable: bool) -> Result<(), Error>

Indicates whether the referer header is automatically updated

+

By default this option is false and corresponds to +CURLOPT_AUTOREFERER.

+
source

pub fn accept_encoding(&mut self, encoding: &str) -> Result<(), Error>

Enables automatic decompression of HTTP downloads.

+

Sets the contents of the Accept-Encoding header sent in an HTTP request. +This enables decoding of a response with Content-Encoding.

+

Currently supported encoding are identity, zlib, and gzip. A +zero-length string passed in will send all accepted encodings.

+

By default this option is not set and corresponds to +CURLOPT_ACCEPT_ENCODING.

+
source

pub fn transfer_encoding(&mut self, enable: bool) -> Result<(), Error>

Request the HTTP Transfer Encoding.

+

By default this option is false and corresponds to +CURLOPT_TRANSFER_ENCODING.

+
source

pub fn follow_location(&mut self, enable: bool) -> Result<(), Error>

Follow HTTP 3xx redirects.

+

Indicates whether any Location headers in the response should get +followed.

+

By default this option is false and corresponds to +CURLOPT_FOLLOWLOCATION.

+
source

pub fn unrestricted_auth(&mut self, enable: bool) -> Result<(), Error>

Send credentials to hosts other than the first as well.

+

Sends username/password credentials even when the host changes as part +of a redirect.

+

By default this option is false and corresponds to +CURLOPT_UNRESTRICTED_AUTH.

+
source

pub fn max_redirections(&mut self, max: u32) -> Result<(), Error>

Set the maximum number of redirects allowed.

+

A value of 0 will refuse any redirect.

+

By default this option is -1 (unlimited) and corresponds to +CURLOPT_MAXREDIRS.

+
source

pub fn post_redirections( + &mut self, + redirects: &PostRedirections +) -> Result<(), Error>

Set the policy for handling redirects to POST requests.

+

By default a POST is changed to a GET when following a redirect. Setting any +of the PostRedirections flags will preserve the POST method for the +selected response codes.

+
source

pub fn put(&mut self, enable: bool) -> Result<(), Error>

Make an HTTP PUT request.

+

By default this option is false and corresponds to CURLOPT_PUT.

+
source

pub fn post(&mut self, enable: bool) -> Result<(), Error>

Make an HTTP POST request.

+

This will also make the library use the +Content-Type: application/x-www-form-urlencoded header.

+

POST data can be specified through post_fields or by specifying a read +function.

+

By default this option is false and corresponds to CURLOPT_POST.

+
source

pub fn post_fields_copy(&mut self, data: &[u8]) -> Result<(), Error>

Configures the data that will be uploaded as part of a POST.

+

Note that the data is copied into this handle and if that’s not desired +then the read callbacks can be used instead.

+

By default this option is not set and corresponds to +CURLOPT_COPYPOSTFIELDS.

+
source

pub fn post_field_size(&mut self, size: u64) -> Result<(), Error>

Configures the size of data that’s going to be uploaded as part of a +POST operation.

+

This is called automatically as part of post_fields and should only +be called if data is being provided in a read callback (and even then +it’s optional).

+

By default this option is not set and corresponds to +CURLOPT_POSTFIELDSIZE_LARGE.

+
source

pub fn httppost(&mut self, form: Form) -> Result<(), Error>

Tells libcurl you want a multipart/formdata HTTP POST to be made and you +instruct what data to pass on to the server in the form argument.

+

By default this option is set to null and corresponds to +CURLOPT_HTTPPOST.

+
source

pub fn referer(&mut self, referer: &str) -> Result<(), Error>

Sets the HTTP referer header

+

By default this option is not set and corresponds to CURLOPT_REFERER.

+
source

pub fn useragent(&mut self, useragent: &str) -> Result<(), Error>

Sets the HTTP user-agent header

+

By default this option is not set and corresponds to +CURLOPT_USERAGENT.

+
source

pub fn http_headers(&mut self, list: List) -> Result<(), Error>

Add some headers to this HTTP request.

+

If you add a header that is otherwise used internally, the value here +takes precedence. If a header is added with no content (like Accept:) +the internally the header will get disabled. To add a header with no +content, use the form MyHeader; (not the trailing semicolon).

+

Headers must not be CRLF terminated. Many replaced headers have common +shortcuts which should be prefered.

+

By default this option is not set and corresponds to +CURLOPT_HTTPHEADER

+
Examples
+
use curl::easy::{Easy, List};
+
+let mut list = List::new();
+list.append("Foo: bar").unwrap();
+list.append("Bar: baz").unwrap();
+
+let mut handle = Easy::new();
+handle.url("https://www.rust-lang.org/").unwrap();
+handle.http_headers(list).unwrap();
+handle.perform().unwrap();
+
source

pub fn cookie(&mut self, cookie: &str) -> Result<(), Error>

Set the contents of the HTTP Cookie header.

+

Pass a string of the form name=contents for one cookie value or +name1=val1; name2=val2 for multiple values.

+

Using this option multiple times will only make the latest string +override the previous ones. This option will not enable the cookie +engine, use cookie_file or cookie_jar to do that.

+

By default this option is not set and corresponds to CURLOPT_COOKIE.

+
source

pub fn cookie_file<P: AsRef<Path>>(&mut self, file: P) -> Result<(), Error>

Set the file name to read cookies from.

+

The cookie data can be in either the old Netscape / Mozilla cookie data +format or just regular HTTP headers (Set-Cookie style) dumped to a file.

+

This also enables the cookie engine, making libcurl parse and send +cookies on subsequent requests with this handle.

+

Given an empty or non-existing file or by passing the empty string (“”) +to this option, you can enable the cookie engine without reading any +initial cookies.

+

If you use this option multiple times, you just add more files to read. +Subsequent files will add more cookies.

+

By default this option is not set and corresponds to +CURLOPT_COOKIEFILE.

+
source

pub fn cookie_jar<P: AsRef<Path>>(&mut self, file: P) -> Result<(), Error>

Set the file name to store cookies to.

+

This will make libcurl write all internally known cookies to the file +when this handle is dropped. If no cookies are known, no file will be +created. Specify “-” as filename to instead have the cookies written to +stdout. Using this option also enables cookies for this session, so if +you for example follow a location it will make matching cookies get sent +accordingly.

+

Note that libcurl doesn’t read any cookies from the cookie jar. If you +want to read cookies from a file, use cookie_file.

+

By default this option is not set and corresponds to +CURLOPT_COOKIEJAR.

+
source

pub fn cookie_session(&mut self, session: bool) -> Result<(), Error>

Start a new cookie session

+

Marks this as a new cookie “session”. It will force libcurl to ignore +all cookies it is about to load that are “session cookies” from the +previous session. By default, libcurl always stores and loads all +cookies, independent if they are session cookies or not. Session cookies +are cookies without expiry date and they are meant to be alive and +existing for this “session” only.

+

By default this option is false and corresponds to +CURLOPT_COOKIESESSION.

+
source

pub fn cookie_list(&mut self, cookie: &str) -> Result<(), Error>

Add to or manipulate cookies held in memory.

+

Such a cookie can be either a single line in Netscape / Mozilla format +or just regular HTTP-style header (Set-Cookie: …) format. This will +also enable the cookie engine. This adds that single cookie to the +internal cookie store.

+

Exercise caution if you are using this option and multiple transfers may +occur. If you use the Set-Cookie format and don’t specify a domain then +the cookie is sent for any domain (even after redirects are followed) +and cannot be modified by a server-set cookie. If a server sets a cookie +of the same name (or maybe you’ve imported one) then both will be sent +on a future transfer to that server, likely not what you intended. +address these issues set a domain in Set-Cookie or use the Netscape +format.

+

Additionally, there are commands available that perform actions if you +pass in these exact strings:

+
    +
  • “ALL” - erases all cookies held in memory
  • +
  • “SESS” - erases all session cookies held in memory
  • +
  • “FLUSH” - write all known cookies to the specified cookie jar
  • +
  • “RELOAD” - reread all cookies from the cookie file
  • +
+

By default this options corresponds to CURLOPT_COOKIELIST

+
source

pub fn get(&mut self, enable: bool) -> Result<(), Error>

Ask for a HTTP GET request.

+

By default this option is false and corresponds to CURLOPT_HTTPGET.

+
source

pub fn ignore_content_length(&mut self, ignore: bool) -> Result<(), Error>

Ignore the content-length header.

+

By default this option is false and corresponds to +CURLOPT_IGNORE_CONTENT_LENGTH.

+
source

pub fn http_content_decoding(&mut self, enable: bool) -> Result<(), Error>

Enable or disable HTTP content decoding.

+

By default this option is true and corresponds to +CURLOPT_HTTP_CONTENT_DECODING.

+
source

pub fn http_transfer_decoding(&mut self, enable: bool) -> Result<(), Error>

Enable or disable HTTP transfer decoding.

+

By default this option is true and corresponds to +CURLOPT_HTTP_TRANSFER_DECODING.

+
source

pub fn range(&mut self, range: &str) -> Result<(), Error>

Indicates the range that this request should retrieve.

+

The string provided should be of the form N-M where either N or M +can be left out. For HTTP transfers multiple ranges separated by commas +are also accepted.

+

By default this option is not set and corresponds to CURLOPT_RANGE.

+
source

pub fn resume_from(&mut self, from: u64) -> Result<(), Error>

Set a point to resume transfer from

+

Specify the offset in bytes you want the transfer to start from.

+

By default this option is 0 and corresponds to +CURLOPT_RESUME_FROM_LARGE.

+
source

pub fn custom_request(&mut self, request: &str) -> Result<(), Error>

Set a custom request string

+

Specifies that a custom request will be made (e.g. a custom HTTP +method). This does not change how libcurl performs internally, just +changes the string sent to the server.

+

By default this option is not set and corresponds to +CURLOPT_CUSTOMREQUEST.

+
source

pub fn fetch_filetime(&mut self, fetch: bool) -> Result<(), Error>

Get the modification time of the remote resource

+

If true, libcurl will attempt to get the modification time of the +remote document in this operation. This requires that the remote server +sends the time or replies to a time querying command. The filetime +function can be used after a transfer to extract the received time (if +any).

+

By default this option is false and corresponds to CURLOPT_FILETIME

+
source

pub fn nobody(&mut self, enable: bool) -> Result<(), Error>

Indicate whether to download the request without getting the body

+

This is useful, for example, for doing a HEAD request.

+

By default this option is false and corresponds to CURLOPT_NOBODY.

+
source

pub fn in_filesize(&mut self, size: u64) -> Result<(), Error>

Set the size of the input file to send off.

+

By default this option is not set and corresponds to +CURLOPT_INFILESIZE_LARGE.

+
source

pub fn upload(&mut self, enable: bool) -> Result<(), Error>

Enable or disable data upload.

+

This means that a PUT request will be made for HTTP and probably wants +to be combined with the read callback as well as the in_filesize +method.

+

By default this option is false and corresponds to CURLOPT_UPLOAD.

+
source

pub fn max_filesize(&mut self, size: u64) -> Result<(), Error>

Configure the maximum file size to download.

+

By default this option is not set and corresponds to +CURLOPT_MAXFILESIZE_LARGE.

+
source

pub fn time_condition(&mut self, cond: TimeCondition) -> Result<(), Error>

Selects a condition for a time request.

+

This value indicates how the time_value option is interpreted.

+

By default this option is not set and corresponds to +CURLOPT_TIMECONDITION.

+
source

pub fn time_value(&mut self, val: i64) -> Result<(), Error>

Sets the time value for a conditional request.

+

The value here should be the number of seconds elapsed since January 1, +1970. To pass how to interpret this value, use time_condition.

+

By default this option is not set and corresponds to +CURLOPT_TIMEVALUE.

+
source

pub fn timeout(&mut self, timeout: Duration) -> Result<(), Error>

Set maximum time the request is allowed to take.

+

Normally, name lookups can take a considerable time and limiting +operations to less than a few minutes risk aborting perfectly normal +operations.

+

If libcurl is built to use the standard system name resolver, that +portion of the transfer will still use full-second resolution for +timeouts with a minimum timeout allowed of one second.

+

In unix-like systems, this might cause signals to be used unless +nosignal is set.

+

Since this puts a hard limit for how long a request is allowed to +take, it has limited use in dynamic use cases with varying transfer +times. You are then advised to explore low_speed_limit, +low_speed_time or using progress_function to implement your own +timeout logic.

+

By default this option is not set and corresponds to +CURLOPT_TIMEOUT_MS.

+
source

pub fn low_speed_limit(&mut self, limit: u32) -> Result<(), Error>

Set the low speed limit in bytes per second.

+

This specifies the average transfer speed in bytes per second that the +transfer should be below during low_speed_time for libcurl to consider +it to be too slow and abort.

+

By default this option is not set and corresponds to +CURLOPT_LOW_SPEED_LIMIT.

+
source

pub fn low_speed_time(&mut self, dur: Duration) -> Result<(), Error>

Set the low speed time period.

+

Specifies the window of time for which if the transfer rate is below +low_speed_limit the request will be aborted.

+

By default this option is not set and corresponds to +CURLOPT_LOW_SPEED_TIME.

+
source

pub fn max_send_speed(&mut self, speed: u64) -> Result<(), Error>

Rate limit data upload speed

+

If an upload exceeds this speed (counted in bytes per second) on +cumulative average during the transfer, the transfer will pause to keep +the average rate less than or equal to the parameter value.

+

By default this option is not set (unlimited speed) and corresponds to +CURLOPT_MAX_SEND_SPEED_LARGE.

+
source

pub fn max_recv_speed(&mut self, speed: u64) -> Result<(), Error>

Rate limit data download speed

+

If a download exceeds this speed (counted in bytes per second) on +cumulative average during the transfer, the transfer will pause to keep +the average rate less than or equal to the parameter value.

+

By default this option is not set (unlimited speed) and corresponds to +CURLOPT_MAX_RECV_SPEED_LARGE.

+
source

pub fn max_connects(&mut self, max: u32) -> Result<(), Error>

Set the maximum connection cache size.

+

The set amount will be the maximum number of simultaneously open +persistent connections that libcurl may cache in the pool associated +with this handle. The default is 5, and there isn’t much point in +changing this value unless you are perfectly aware of how this works and +changes libcurl’s behaviour. This concerns connections using any of the +protocols that support persistent connections.

+

When reaching the maximum limit, curl closes the oldest one in the cache +to prevent increasing the number of open connections.

+

By default this option is set to 5 and corresponds to +CURLOPT_MAXCONNECTS

+
source

pub fn maxage_conn(&mut self, max_age: Duration) -> Result<(), Error>

Set the maximum idle time allowed for a connection.

+

This configuration sets the maximum time that a connection inside of the connection cache +can be reused. Any connection older than this value will be considered stale and will +be closed.

+

By default, a value of 118 seconds is used.

+
source

pub fn fresh_connect(&mut self, enable: bool) -> Result<(), Error>

Force a new connection to be used.

+

Makes the next transfer use a new (fresh) connection by force instead of +trying to re-use an existing one. This option should be used with +caution and only if you understand what it does as it may seriously +impact performance.

+

By default this option is false and corresponds to +CURLOPT_FRESH_CONNECT.

+
source

pub fn forbid_reuse(&mut self, enable: bool) -> Result<(), Error>

Make connection get closed at once after use.

+

Makes libcurl explicitly close the connection when done with the +transfer. Normally, libcurl keeps all connections alive when done with +one transfer in case a succeeding one follows that can re-use them. +This option should be used with caution and only if you understand what +it does as it can seriously impact performance.

+

By default this option is false and corresponds to +CURLOPT_FORBID_REUSE.

+
source

pub fn connect_timeout(&mut self, timeout: Duration) -> Result<(), Error>

Timeout for the connect phase

+

This is the maximum time that you allow the connection phase to the +server to take. This only limits the connection phase, it has no impact +once it has connected.

+

By default this value is 300 seconds and corresponds to +CURLOPT_CONNECTTIMEOUT_MS.

+
source

pub fn ip_resolve(&mut self, resolve: IpResolve) -> Result<(), Error>

Specify which IP protocol version to use

+

Allows an application to select what kind of IP addresses to use when +resolving host names. This is only interesting when using host names +that resolve addresses using more than one version of IP.

+

By default this value is “any” and corresponds to CURLOPT_IPRESOLVE.

+
source

pub fn resolve(&mut self, list: List) -> Result<(), Error>

Specify custom host name to IP address resolves.

+

Allows specifying hostname to IP mappins to use before trying the +system resolver.

+
Examples
+
use curl::easy::{Easy, List};
+
+let mut list = List::new();
+list.append("www.rust-lang.org:443:185.199.108.153").unwrap();
+
+let mut handle = Easy::new();
+handle.url("https://www.rust-lang.org/").unwrap();
+handle.resolve(list).unwrap();
+handle.perform().unwrap();
+
source

pub fn connect_only(&mut self, enable: bool) -> Result<(), Error>

Configure whether to stop when connected to target server

+

When enabled it tells the library to perform all the required proxy +authentication and connection setup, but no data transfer, and then +return.

+

The option can be used to simply test a connection to a server.

+

By default this value is false and corresponds to +CURLOPT_CONNECT_ONLY.

+
source

pub fn ssl_cert<P: AsRef<Path>>(&mut self, cert: P) -> Result<(), Error>

Sets the SSL client certificate.

+

The string should be the file name of your client certificate. The +default format is “P12” on Secure Transport and “PEM” on other engines, +and can be changed with ssl_cert_type.

+

With NSS or Secure Transport, this can also be the nickname of the +certificate you wish to authenticate with as it is named in the security +database. If you want to use a file from the current directory, please +precede it with “./” prefix, in order to avoid confusion with a +nickname.

+

When using a client certificate, you most likely also need to provide a +private key with ssl_key.

+

By default this option is not set and corresponds to CURLOPT_SSLCERT.

+
source

pub fn ssl_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error>

Set the SSL client certificate using an in-memory blob.

+

The specified byte buffer should contain the binary content of your +client certificate, which will be copied into the handle. The format of +the certificate can be specified with ssl_cert_type.

+

By default this option is not set and corresponds to +CURLOPT_SSLCERT_BLOB.

+
source

pub fn ssl_cert_type(&mut self, kind: &str) -> Result<(), Error>

Specify type of the client SSL certificate.

+

The string should be the format of your certificate. Supported formats +are “PEM” and “DER”, except with Secure Transport. OpenSSL (versions +0.9.3 and later) and Secure Transport (on iOS 5 or later, or OS X 10.7 +or later) also support “P12” for PKCS#12-encoded files.

+

By default this option is “PEM” and corresponds to +CURLOPT_SSLCERTTYPE.

+
source

pub fn ssl_key<P: AsRef<Path>>(&mut self, key: P) -> Result<(), Error>

Specify private keyfile for TLS and SSL client cert.

+

The string should be the file name of your private key. The default +format is “PEM” and can be changed with ssl_key_type.

+

(iOS and Mac OS X only) This option is ignored if curl was built against +Secure Transport. Secure Transport expects the private key to be already +present in the keychain or PKCS#12 file containing the certificate.

+

By default this option is not set and corresponds to CURLOPT_SSLKEY.

+
source

pub fn ssl_key_blob(&mut self, blob: &[u8]) -> Result<(), Error>

Specify an SSL private key using an in-memory blob.

+

The specified byte buffer should contain the binary content of your +private key, which will be copied into the handle. The format of +the private key can be specified with ssl_key_type.

+

By default this option is not set and corresponds to +CURLOPT_SSLKEY_BLOB.

+
source

pub fn ssl_key_type(&mut self, kind: &str) -> Result<(), Error>

Set type of the private key file.

+

The string should be the format of your private key. Supported formats +are “PEM”, “DER” and “ENG”.

+

The format “ENG” enables you to load the private key from a crypto +engine. In this case ssl_key is used as an identifier passed to +the engine. You have to set the crypto engine with ssl_engine. +“DER” format key file currently does not work because of a bug in +OpenSSL.

+

By default this option is “PEM” and corresponds to +CURLOPT_SSLKEYTYPE.

+
source

pub fn key_password(&mut self, password: &str) -> Result<(), Error>

Set passphrase to private key.

+

This will be used as the password required to use the ssl_key. +You never needed a pass phrase to load a certificate but you need one to +load your private key.

+

By default this option is not set and corresponds to +CURLOPT_KEYPASSWD.

+
source

pub fn ssl_cainfo_blob(&mut self, blob: &[u8]) -> Result<(), Error>

Set the SSL Certificate Authorities using an in-memory blob.

+

The specified byte buffer should contain the binary content of one +or more PEM-encoded CA certificates, which will be copied into +the handle.

+

By default this option is not set and corresponds to +CURLOPT_CAINFO_BLOB.

+
source

pub fn proxy_ssl_cainfo_blob(&mut self, blob: &[u8]) -> Result<(), Error>

Set the SSL Certificate Authorities for HTTPS proxies using an in-memory +blob.

+

The specified byte buffer should contain the binary content of one +or more PEM-encoded CA certificates, which will be copied into +the handle.

+

By default this option is not set and corresponds to +CURLOPT_PROXY_CAINFO_BLOB.

+
source

pub fn ssl_engine(&mut self, engine: &str) -> Result<(), Error>

Set the SSL engine identifier.

+

This will be used as the identifier for the crypto engine you want to +use for your private key.

+

By default this option is not set and corresponds to +CURLOPT_SSLENGINE.

+
source

pub fn ssl_engine_default(&mut self, enable: bool) -> Result<(), Error>

Make this handle’s SSL engine the default.

+

By default this option is not set and corresponds to +CURLOPT_SSLENGINE_DEFAULT.

+
source

pub fn http_version(&mut self, version: HttpVersion) -> Result<(), Error>

Set preferred HTTP version.

+

By default this option is not set and corresponds to +CURLOPT_HTTP_VERSION.

+
source

pub fn ssl_version(&mut self, version: SslVersion) -> Result<(), Error>

Set preferred TLS/SSL version.

+

By default this option is not set and corresponds to +CURLOPT_SSLVERSION.

+
source

pub fn proxy_ssl_version(&mut self, version: SslVersion) -> Result<(), Error>

Set preferred TLS/SSL version when connecting to an HTTPS proxy.

+

By default this option is not set and corresponds to +CURLOPT_PROXY_SSLVERSION.

+
source

pub fn ssl_min_max_version( + &mut self, + min_version: SslVersion, + max_version: SslVersion +) -> Result<(), Error>

Set preferred TLS/SSL version with minimum version and maximum version.

+

By default this option is not set and corresponds to +CURLOPT_SSLVERSION.

+
source

pub fn proxy_ssl_min_max_version( + &mut self, + min_version: SslVersion, + max_version: SslVersion +) -> Result<(), Error>

Set preferred TLS/SSL version with minimum version and maximum version +when connecting to an HTTPS proxy.

+

By default this option is not set and corresponds to +CURLOPT_PROXY_SSLVERSION.

+
source

pub fn ssl_verify_host(&mut self, verify: bool) -> Result<(), Error>

Verify the certificate’s name against host.

+

This should be disabled with great caution! It basically disables the +security features of SSL if it is disabled.

+

By default this option is set to true and corresponds to +CURLOPT_SSL_VERIFYHOST.

+
source

pub fn proxy_ssl_verify_host(&mut self, verify: bool) -> Result<(), Error>

Verify the certificate’s name against host for HTTPS proxy.

+

This should be disabled with great caution! It basically disables the +security features of SSL if it is disabled.

+

By default this option is set to true and corresponds to +CURLOPT_PROXY_SSL_VERIFYHOST.

+
source

pub fn ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error>

Verify the peer’s SSL certificate.

+

This should be disabled with great caution! It basically disables the +security features of SSL if it is disabled.

+

By default this option is set to true and corresponds to +CURLOPT_SSL_VERIFYPEER.

+
source

pub fn proxy_ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error>

Verify the peer’s SSL certificate for HTTPS proxy.

+

This should be disabled with great caution! It basically disables the +security features of SSL if it is disabled.

+

By default this option is set to true and corresponds to +CURLOPT_PROXY_SSL_VERIFYPEER.

+
source

pub fn cainfo<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>

Specify the path to Certificate Authority (CA) bundle

+

The file referenced should hold one or more certificates to verify the +peer with.

+

This option is by default set to the system path where libcurl’s cacert +bundle is assumed to be stored, as established at build time.

+

If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module +(libnsspem.so) needs to be available for this option to work properly.

+

By default this option is the system defaults, and corresponds to +CURLOPT_CAINFO.

+
source

pub fn issuer_cert<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>

Set the issuer SSL certificate filename

+

Specifies a file holding a CA certificate in PEM format. If the option +is set, an additional check against the peer certificate is performed to +verify the issuer is indeed the one associated with the certificate +provided by the option. This additional check is useful in multi-level +PKI where one needs to enforce that the peer certificate is from a +specific branch of the tree.

+

This option makes sense only when used in combination with the +Easy2::ssl_verify_peer option. Otherwise, the result of the check is +not considered as failure.

+

By default this option is not set and corresponds to +CURLOPT_ISSUERCERT.

+
source

pub fn proxy_issuer_cert<P: AsRef<Path>>( + &mut self, + path: P +) -> Result<(), Error>

Set the issuer SSL certificate filename for HTTPS proxies

+

Specifies a file holding a CA certificate in PEM format. If the option +is set, an additional check against the peer certificate is performed to +verify the issuer is indeed the one associated with the certificate +provided by the option. This additional check is useful in multi-level +PKI where one needs to enforce that the peer certificate is from a +specific branch of the tree.

+

This option makes sense only when used in combination with the +Easy2::proxy_ssl_verify_peer option. Otherwise, the result of the +check is not considered as failure.

+

By default this option is not set and corresponds to +CURLOPT_PROXY_ISSUERCERT.

+
source

pub fn issuer_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error>

Set the issuer SSL certificate using an in-memory blob.

+

The specified byte buffer should contain the binary content of a CA +certificate in the PEM format. The certificate will be copied into the +handle.

+

By default this option is not set and corresponds to +CURLOPT_ISSUERCERT_BLOB.

+
source

pub fn proxy_issuer_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error>

Set the issuer SSL certificate for HTTPS proxies using an in-memory blob.

+

The specified byte buffer should contain the binary content of a CA +certificate in the PEM format. The certificate will be copied into the +handle.

+

By default this option is not set and corresponds to +CURLOPT_PROXY_ISSUERCERT_BLOB.

+
source

pub fn capath<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>

Specify directory holding CA certificates

+

Names a directory holding multiple CA certificates to verify the peer +with. If libcurl is built against OpenSSL, the certificate directory +must be prepared using the openssl c_rehash utility. This makes sense +only when used in combination with the ssl_verify_peer option.

+

By default this option is not set and corresponds to CURLOPT_CAPATH.

+
source

pub fn crlfile<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>

Specify a Certificate Revocation List file

+

Names a file with the concatenation of CRL (in PEM format) to use in the +certificate validation that occurs during the SSL exchange.

+

When curl is built to use NSS or GnuTLS, there is no way to influence +the use of CRL passed to help in the verification process. When libcurl +is built with OpenSSL support, X509_V_FLAG_CRL_CHECK and +X509_V_FLAG_CRL_CHECK_ALL are both set, requiring CRL check against all +the elements of the certificate chain if a CRL file is passed.

+

This option makes sense only when used in combination with the +Easy2::ssl_verify_peer option.

+

A specific error code (is_ssl_crl_badfile) is defined with the +option. It is returned when the SSL exchange fails because the CRL file +cannot be loaded. A failure in certificate verification due to a +revocation information found in the CRL does not trigger this specific +error.

+

By default this option is not set and corresponds to CURLOPT_CRLFILE.

+
source

pub fn proxy_crlfile<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>

Specify a Certificate Revocation List file to use when connecting to an +HTTPS proxy.

+

Names a file with the concatenation of CRL (in PEM format) to use in the +certificate validation that occurs during the SSL exchange.

+

When curl is built to use NSS or GnuTLS, there is no way to influence +the use of CRL passed to help in the verification process. When libcurl +is built with OpenSSL support, X509_V_FLAG_CRL_CHECK and +X509_V_FLAG_CRL_CHECK_ALL are both set, requiring CRL check against all +the elements of the certificate chain if a CRL file is passed.

+

This option makes sense only when used in combination with the +Easy2::proxy_ssl_verify_peer option.

+

By default this option is not set and corresponds to +CURLOPT_PROXY_CRLFILE.

+
source

pub fn certinfo(&mut self, enable: bool) -> Result<(), Error>

Request SSL certificate information

+

Enable libcurl’s certificate chain info gatherer. With this enabled, +libcurl will extract lots of information and data about the certificates +in the certificate chain used in the SSL connection.

+

By default this option is false and corresponds to +CURLOPT_CERTINFO.

+
source

pub fn pinned_public_key(&mut self, pubkey: &str) -> Result<(), Error>

Set pinned public key.

+

Pass a pointer to a zero terminated string as parameter. The string can +be the file name of your pinned public key. The file format expected is +“PEM” or “DER”. The string can also be any number of base64 encoded +sha256 hashes preceded by “sha256//” and separated by “;”

+

When negotiating a TLS or SSL connection, the server sends a certificate +indicating its identity. A public key is extracted from this certificate +and if it does not exactly match the public key provided to this option, +curl will abort the connection before sending or receiving any data.

+

By default this option is not set and corresponds to +CURLOPT_PINNEDPUBLICKEY.

+
source

pub fn random_file<P: AsRef<Path>>(&mut self, p: P) -> Result<(), Error>

Specify a source for random data

+

The file will be used to read from to seed the random engine for SSL and +more.

+

By default this option is not set and corresponds to +CURLOPT_RANDOM_FILE.

+
source

pub fn egd_socket<P: AsRef<Path>>(&mut self, p: P) -> Result<(), Error>

Specify EGD socket path.

+

Indicates the path name to the Entropy Gathering Daemon socket. It will +be used to seed the random engine for SSL.

+

By default this option is not set and corresponds to +CURLOPT_EGDSOCKET.

+
source

pub fn ssl_cipher_list(&mut self, ciphers: &str) -> Result<(), Error>

Specify ciphers to use for TLS.

+

Holds the list of ciphers to use for the SSL connection. The list must +be syntactically correct, it consists of one or more cipher strings +separated by colons. Commas or spaces are also acceptable separators +but colons are normally used, !, - and + can be used as operators.

+

For OpenSSL and GnuTLS valid examples of cipher lists include ‘RC4-SHA’, +´SHA1+DES´, ‘TLSv1’ and ‘DEFAULT’. The default list is normally set when +you compile OpenSSL.

+

You’ll find more details about cipher lists on this URL:

+

https://www.openssl.org/docs/apps/ciphers.html

+

For NSS, valid examples of cipher lists include ‘rsa_rc4_128_md5’, +´rsa_aes_128_sha´, etc. With NSS you don’t add/remove ciphers. If one +uses this option then all known ciphers are disabled and only those +passed in are enabled.

+

By default this option is not set and corresponds to +CURLOPT_SSL_CIPHER_LIST.

+
source

pub fn proxy_ssl_cipher_list(&mut self, ciphers: &str) -> Result<(), Error>

Specify ciphers to use for TLS for an HTTPS proxy.

+

Holds the list of ciphers to use for the SSL connection. The list must +be syntactically correct, it consists of one or more cipher strings +separated by colons. Commas or spaces are also acceptable separators +but colons are normally used, !, - and + can be used as operators.

+

For OpenSSL and GnuTLS valid examples of cipher lists include ‘RC4-SHA’, +´SHA1+DES´, ‘TLSv1’ and ‘DEFAULT’. The default list is normally set when +you compile OpenSSL.

+

You’ll find more details about cipher lists on this URL:

+

https://www.openssl.org/docs/apps/ciphers.html

+

For NSS, valid examples of cipher lists include ‘rsa_rc4_128_md5’, +´rsa_aes_128_sha´, etc. With NSS you don’t add/remove ciphers. If one +uses this option then all known ciphers are disabled and only those +passed in are enabled.

+

By default this option is not set and corresponds to +CURLOPT_PROXY_SSL_CIPHER_LIST.

+
source

pub fn ssl_sessionid_cache(&mut self, enable: bool) -> Result<(), Error>

Enable or disable use of the SSL session-ID cache

+

By default all transfers are done using the cache enabled. While nothing +ever should get hurt by attempting to reuse SSL session-IDs, there seem +to be or have been broken SSL implementations in the wild that may +require you to disable this in order for you to succeed.

+

This corresponds to the CURLOPT_SSL_SESSIONID_CACHE option.

+
source

pub fn ssl_options(&mut self, bits: &SslOpt) -> Result<(), Error>

Set SSL behavior options

+

Inform libcurl about SSL specific behaviors.

+

This corresponds to the CURLOPT_SSL_OPTIONS option.

+
source

pub fn proxy_ssl_options(&mut self, bits: &SslOpt) -> Result<(), Error>

Set SSL behavior options for proxies

+

Inform libcurl about SSL specific behaviors.

+

This corresponds to the CURLOPT_PROXY_SSL_OPTIONS option.

+
source

pub fn expect_100_timeout(&mut self, timeout: Duration) -> Result<(), Error>

Set maximum time to wait for Expect 100 request before sending body.

+

curl has internal heuristics that trigger the use of a Expect +header for large enough request bodies where the client first sends the +request header along with an Expect: 100-continue header. The server +is supposed to validate the headers and respond with a 100 response +status code after which curl will send the actual request body.

+

However, if the server does not respond to the initial request +within CURLOPT_EXPECT_100_TIMEOUT_MS then curl will send the +request body anyways.

+

The best-case scenario is where the request is invalid and the server +replies with a 417 Expectation Failed without having to wait for or process +the request body at all. However, this behaviour can also lead to higher +total latency since in the best case, an additional server roundtrip is required +and in the worst case, the request is delayed by CURLOPT_EXPECT_100_TIMEOUT_MS.

+

More info: https://curl.se/libcurl/c/CURLOPT_EXPECT_100_TIMEOUT_MS.html

+

By default this option is not set and corresponds to +CURLOPT_EXPECT_100_TIMEOUT_MS.

+
source

pub fn time_condition_unmet(&self) -> Result<bool, Error>

Get info on unmet time conditional

+

Returns if the condition provided in the previous request didn’t match

+

option is not supported

+
source

pub fn effective_url(&self) -> Result<Option<&str>, Error>

Get the last used URL

+

In cases when you’ve asked libcurl to follow redirects, it may +not be the same value you set with url.

+

This methods corresponds to the CURLINFO_EFFECTIVE_URL option.

+

Returns Ok(None) if no effective url is listed or Err if an error +happens or the underlying bytes aren’t valid utf-8.

+
source

pub fn effective_url_bytes(&self) -> Result<Option<&[u8]>, Error>

Get the last used URL, in bytes

+

In cases when you’ve asked libcurl to follow redirects, it may +not be the same value you set with url.

+

This methods corresponds to the CURLINFO_EFFECTIVE_URL option.

+

Returns Ok(None) if no effective url is listed or Err if an error +happens or the underlying bytes aren’t valid utf-8.

+
source

pub fn response_code(&self) -> Result<u32, Error>

Get the last response code

+

The stored value will be zero if no server response code has been +received. Note that a proxy’s CONNECT response should be read with +http_connectcode and not this.

+

Corresponds to CURLINFO_RESPONSE_CODE and returns an error if this +option is not supported.

+
source

pub fn http_connectcode(&self) -> Result<u32, Error>

Get the CONNECT response code

+

Returns the last received HTTP proxy response code to a CONNECT request. +The returned value will be zero if no such response code was available.

+

Corresponds to CURLINFO_HTTP_CONNECTCODE and returns an error if this +option is not supported.

+
source

pub fn filetime(&self) -> Result<Option<i64>, Error>

Get the remote time of the retrieved document

+

Returns the remote time of the retrieved document (in number of seconds +since 1 Jan 1970 in the GMT/UTC time zone). If you get None, it can be +because of many reasons (it might be unknown, the server might hide it +or the server doesn’t support the command that tells document time etc) +and the time of the document is unknown.

+

Note that you must tell the server to collect this information before +the transfer is made, by using the filetime method to +or you will unconditionally get a None back.

+

This corresponds to CURLINFO_FILETIME and may return an error if the +option is not supported

+
source

pub fn download_size(&self) -> Result<f64, Error>

Get the number of downloaded bytes

+

Returns the total amount of bytes that were downloaded. +The amount is only for the latest transfer and will be reset again for each new transfer. +This counts actual payload data, what’s also commonly called body. +All meta and header data are excluded and will not be counted in this number.

+

This corresponds to CURLINFO_SIZE_DOWNLOAD and may return an error if the +option is not supported

+
source

pub fn upload_size(&self) -> Result<f64, Error>

Get the number of uploaded bytes

+

Returns the total amount of bytes that were uploaded.

+

This corresponds to CURLINFO_SIZE_UPLOAD and may return an error if the +option is not supported

+
source

pub fn content_length_download(&self) -> Result<f64, Error>

Get the content-length of the download

+

Returns the content-length of the download. +This is the value read from the Content-Length: field

+

This corresponds to CURLINFO_CONTENT_LENGTH_DOWNLOAD and may return an error if the +option is not supported

+
source

pub fn total_time(&self) -> Result<Duration, Error>

Get total time of previous transfer

+

Returns the total time for the previous transfer, +including name resolving, TCP connect etc.

+

Corresponds to CURLINFO_TOTAL_TIME and may return an error if the +option isn’t supported.

+
source

pub fn namelookup_time(&self) -> Result<Duration, Error>

Get the name lookup time

+

Returns the total time from the start +until the name resolving was completed.

+

Corresponds to CURLINFO_NAMELOOKUP_TIME and may return an error if the +option isn’t supported.

+
source

pub fn connect_time(&self) -> Result<Duration, Error>

Get the time until connect

+

Returns the total time from the start +until the connection to the remote host (or proxy) was completed.

+

Corresponds to CURLINFO_CONNECT_TIME and may return an error if the +option isn’t supported.

+
source

pub fn appconnect_time(&self) -> Result<Duration, Error>

Get the time until the SSL/SSH handshake is completed

+

Returns the total time it took from the start until the SSL/SSH +connect/handshake to the remote host was completed. This time is most often +very near to the pretransfer_time time, except for cases such as +HTTP pipelining where the pretransfer time can be delayed due to waits in +line for the pipeline and more.

+

Corresponds to CURLINFO_APPCONNECT_TIME and may return an error if the +option isn’t supported.

+
source

pub fn pretransfer_time(&self) -> Result<Duration, Error>

Get the time until the file transfer start

+

Returns the total time it took from the start until the file +transfer is just about to begin. This includes all pre-transfer commands +and negotiations that are specific to the particular protocol(s) involved. +It does not involve the sending of the protocol- specific request that +triggers a transfer.

+

Corresponds to CURLINFO_PRETRANSFER_TIME and may return an error if the +option isn’t supported.

+
source

pub fn starttransfer_time(&self) -> Result<Duration, Error>

Get the time until the first byte is received

+

Returns the total time it took from the start until the first +byte is received by libcurl. This includes pretransfer_time and +also the time the server needs to calculate the result.

+

Corresponds to CURLINFO_STARTTRANSFER_TIME and may return an error if the +option isn’t supported.

+
source

pub fn redirect_time(&self) -> Result<Duration, Error>

Get the time for all redirection steps

+

Returns the total time it took for all redirection steps +include name lookup, connect, pretransfer and transfer before final +transaction was started. redirect_time contains the complete +execution time for multiple redirections.

+

Corresponds to CURLINFO_REDIRECT_TIME and may return an error if the +option isn’t supported.

+
source

pub fn redirect_count(&self) -> Result<u32, Error>

Get the number of redirects

+

Corresponds to CURLINFO_REDIRECT_COUNT and may return an error if the +option isn’t supported.

+
source

pub fn redirect_url(&self) -> Result<Option<&str>, Error>

Get the URL a redirect would go to

+

Returns the URL a redirect would take you to if you would enable +follow_location. This can come very handy if you think using the +built-in libcurl redirect logic isn’t good enough for you but you would +still prefer to avoid implementing all the magic of figuring out the new +URL.

+

Corresponds to CURLINFO_REDIRECT_URL and may return an error if the +url isn’t valid utf-8 or an error happens.

+
source

pub fn redirect_url_bytes(&self) -> Result<Option<&[u8]>, Error>

Get the URL a redirect would go to, in bytes

+

Returns the URL a redirect would take you to if you would enable +follow_location. This can come very handy if you think using the +built-in libcurl redirect logic isn’t good enough for you but you would +still prefer to avoid implementing all the magic of figuring out the new +URL.

+

Corresponds to CURLINFO_REDIRECT_URL and may return an error.

+
source

pub fn header_size(&self) -> Result<u64, Error>

Get size of retrieved headers

+

Corresponds to CURLINFO_HEADER_SIZE and may return an error if the +option isn’t supported.

+
source

pub fn request_size(&self) -> Result<u64, Error>

Get size of sent request.

+

Corresponds to CURLINFO_REQUEST_SIZE and may return an error if the +option isn’t supported.

+
source

pub fn content_type(&self) -> Result<Option<&str>, Error>

Get Content-Type

+

Returns the content-type of the downloaded object. This is the value +read from the Content-Type: field. If you get None, it means that the +server didn’t send a valid Content-Type header or that the protocol +used doesn’t support this.

+

Corresponds to CURLINFO_CONTENT_TYPE and may return an error if the +option isn’t supported.

+
source

pub fn content_type_bytes(&self) -> Result<Option<&[u8]>, Error>

Get Content-Type, in bytes

+

Returns the content-type of the downloaded object. This is the value +read from the Content-Type: field. If you get None, it means that the +server didn’t send a valid Content-Type header or that the protocol +used doesn’t support this.

+

Corresponds to CURLINFO_CONTENT_TYPE and may return an error if the +option isn’t supported.

+
source

pub fn os_errno(&self) -> Result<i32, Error>

Get errno number from last connect failure.

+

Note that the value is only set on failure, it is not reset upon a +successful operation. The number is OS and system specific.

+

Corresponds to CURLINFO_OS_ERRNO and may return an error if the +option isn’t supported.

+
source

pub fn primary_ip(&self) -> Result<Option<&str>, Error>

Get IP address of last connection.

+

Returns a string holding the IP address of the most recent connection +done with this curl handle. This string may be IPv6 when that is +enabled.

+

Corresponds to CURLINFO_PRIMARY_IP and may return an error if the +option isn’t supported.

+
source

pub fn primary_port(&self) -> Result<u16, Error>

Get the latest destination port number

+

Corresponds to CURLINFO_PRIMARY_PORT and may return an error if the +option isn’t supported.

+
source

pub fn local_ip(&self) -> Result<Option<&str>, Error>

Get local IP address of last connection

+

Returns a string holding the IP address of the local end of most recent +connection done with this curl handle. This string may be IPv6 when that +is enabled.

+

Corresponds to CURLINFO_LOCAL_IP and may return an error if the +option isn’t supported.

+
source

pub fn local_port(&self) -> Result<u16, Error>

Get the latest local port number

+

Corresponds to CURLINFO_LOCAL_PORT and may return an error if the +option isn’t supported.

+
source

pub fn cookies(&mut self) -> Result<List, Error>

Get all known cookies

+

Returns a linked-list of all cookies cURL knows (expired ones, too).

+

Corresponds to the CURLINFO_COOKIELIST option and may return an error +if the option isn’t supported.

+
source

pub fn pipewait(&mut self, wait: bool) -> Result<(), Error>

Wait for pipelining/multiplexing

+

Set wait to true to tell libcurl to prefer to wait for a connection to +confirm or deny that it can do pipelining or multiplexing before +continuing.

+

When about to perform a new transfer that allows pipelining or +multiplexing, libcurl will check for existing connections to re-use and +pipeline on. If no such connection exists it will immediately continue +and create a fresh new connection to use.

+

By setting this option to true - and having pipelining(true, true) +enabled for the multi handle this transfer is associated with - libcurl +will instead wait for the connection to reveal if it is possible to +pipeline/multiplex on before it continues. This enables libcurl to much +better keep the number of connections to a minimum when using pipelining +or multiplexing protocols.

+

The effect thus becomes that with this option set, libcurl prefers to +wait and re-use an existing connection for pipelining rather than the +opposite: prefer to open a new connection rather than waiting.

+

The waiting time is as long as it takes for the connection to get up and +for libcurl to get the necessary response back that informs it about its +protocol and support level.

+

This corresponds to the CURLOPT_PIPEWAIT option.

+
source

pub fn http_09_allowed(&mut self, allow: bool) -> Result<(), Error>

Allow HTTP/0.9 compliant responses

+

Set allow to true to tell libcurl to allow HTTP/0.9 responses. A HTTP/0.9 +response is a server response entirely without headers and only a body.

+

By default this option is not set and corresponds to +CURLOPT_HTTP09_ALLOWED.

+
source

pub fn perform(&self) -> Result<(), Error>

After options have been set, this will perform the transfer described by +the options.

+

This performs the request in a synchronous fashion. This can be used +multiple times for one easy handle and libcurl will attempt to re-use +the same connection for all transfers.

+

This method will preserve all options configured in this handle for the +next request, and if that is not desired then the options can be +manually reset or the reset method can be called.

+

Note that this method takes &self, which is quite important! This +allows applications to close over the handle in various callbacks to +call methods like unpause_write and unpause_read while a transfer is +in progress.

+
source

pub fn upkeep(&self) -> Result<(), Error>

Some protocols have “connection upkeep” mechanisms. These mechanisms +usually send some traffic on existing connections in order to keep them +alive; this can prevent connections from being closed due to overzealous +firewalls, for example.

+

Currently the only protocol with a connection upkeep mechanism is +HTTP/2: when the connection upkeep interval is exceeded and upkeep() is +called, an HTTP/2 PING frame is sent on the connection.

+
source

pub fn unpause_read(&self) -> Result<(), Error>

Unpause reading on a connection.

+

Using this function, you can explicitly unpause a connection that was +previously paused.

+

A connection can be paused by letting the read or the write callbacks +return ReadError::Pause or WriteError::Pause.

+

To unpause, you may for example call this from the progress callback +which gets called at least once per second, even if the connection is +paused.

+

The chance is high that you will get your write callback called before +this function returns.

+
source

pub fn unpause_write(&self) -> Result<(), Error>

Unpause writing on a connection.

+

Using this function, you can explicitly unpause a connection that was +previously paused.

+

A connection can be paused by letting the read or the write callbacks +return ReadError::Pause or WriteError::Pause. A write callback that +returns pause signals to the library that it couldn’t take care of any +data at all, and that data will then be delivered again to the callback +when the writing is later unpaused.

+

To unpause, you may for example call this from the progress callback +which gets called at least once per second, even if the connection is +paused.

+
source

pub fn url_encode(&mut self, s: &[u8]) -> String

URL encodes a string s

+
source

pub fn url_decode(&mut self, s: &str) -> Vec<u8>

URL decodes a string s, returning None if it fails

+
source

pub fn recv(&mut self, data: &mut [u8]) -> Result<usize, Error>

Receives data from a connected socket.

+

Only useful after a successful perform with the connect_only option +set as well.

+
source

pub fn send(&mut self, data: &[u8]) -> Result<usize, Error>

Sends data over the connected socket.

+

Only useful after a successful perform with the connect_only option +set as well.

+
source

pub fn raw(&self) -> *mut CURL

Get a pointer to the raw underlying CURL handle.

+
source

pub fn take_error_buf(&self) -> Option<String>

Returns the contents of the internal error buffer, if available.

+

When an easy handle is created it configured the CURLOPT_ERRORBUFFER +parameter and instructs libcurl to store more error information into a +buffer for better error messages and better debugging. The contents of +that buffer are automatically coupled with all errors for methods on +this type, but if manually invoking APIs the contents will need to be +extracted with this method.

+

Put another way, you probably don’t need this, you’re probably already +getting nice error messages!

+

This function will clear the internal buffer, so this is an operation +that mutates the handle internally.

+

Trait Implementations§

source§

impl<H: Debug> Debug for Easy2<H>

source§

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

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

impl<H> Drop for Easy2<H>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<H> !RefUnwindSafe for Easy2<H>

§

impl<H> Send for Easy2<H>
where + H: Send,

§

impl<H> !Sync for Easy2<H>

§

impl<H> Unpin for Easy2<H>

§

impl<H> UnwindSafe for Easy2<H>
where + H: UnwindSafe,

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, 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.
\ No newline at end of file diff --git a/curl/easy/struct.Form.html b/curl/easy/struct.Form.html new file mode 100644 index 000000000..c7f847dc4 --- /dev/null +++ b/curl/easy/struct.Form.html @@ -0,0 +1,19 @@ +Form in curl::easy - Rust +

Struct curl::easy::Form

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

Multipart/formdata for an HTTP POST request.

+

This structure is built up and then passed to the Easy::httppost method to +be sent off with a request.

+

Implementations§

source§

impl Form

source

pub fn new() -> Form

Creates a new blank form ready for the addition of new data.

+
source

pub fn part<'a, 'data>(&'a mut self, name: &'data str) -> Part<'a, 'data>

Prepares adding a new part to this Form

+

Note that the part is not actually added to the form until the add +method is called on Part, which may or may not fail.

+

Trait Implementations§

source§

impl Debug for Form

source§

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

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

impl Drop for Form

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Form

§

impl !Send for Form

§

impl !Sync for Form

§

impl Unpin for Form

§

impl UnwindSafe for Form

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, 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.
\ No newline at end of file diff --git a/curl/easy/struct.Iter.html b/curl/easy/struct.Iter.html new file mode 100644 index 000000000..531699003 --- /dev/null +++ b/curl/easy/struct.Iter.html @@ -0,0 +1,193 @@ +Iter in curl::easy - Rust +

Struct curl::easy::Iter

source ·
pub struct Iter<'a> { /* private fields */ }
Expand description

An iterator over List

+

Trait Implementations§

source§

impl<'a> Clone for Iter<'a>

source§

fn clone(&self) -> Iter<'a>

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<'a> Debug for Iter<'a>

source§

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

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

impl<'a> Iterator for Iter<'a>

§

type Item = &'a [u8]

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<&'a [u8]>

Advances the iterator and returns the next value. Read more
source§

fn next_chunk<const N: usize>( + &mut self +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
1.0.0 · source§

fn count(self) -> usize
where + Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>
where + Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>
where + Self: Sized,

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
where + Self: Sized, + G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each +element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)
where + Self: Sized, + F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>
where + Self: Sized,

Creates an iterator which gives the current iteration count as well as +the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>
where + Self: Sized,

Creates an iterator which can use the peek and peek_mut methods +to look at the next element of the iterator without consuming it. See +their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
where + Self: Sized, + P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>
where + Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>
where + Self: Sized,

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where + Self: Sized, + F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but +unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where + Self: Sized, + U: IntoIterator, + F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
source§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
where + Self: Sized, + F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over +self and returns an iterator over the outputs of f. Like slice::windows(), +the windows during mapping overlap as well. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>
where + Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where + Self: Sized, + F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> B
where + B: FromIterator<Self::Item>, + Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut E
where + E: Extend<Self::Item>, + Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)
where + Self: Sized, + B: Default + Extend<Self::Item>, + F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> bool
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> R
where + Self: Sized, + F: FnMut(Self::Item) -> R, + R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, +returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more
source§

fn try_reduce<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> R, + R: Try<Output = Self::Item>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the +closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns +the first non-none result. Read more
source§

fn try_find<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
where + Self: Sized, + F: FnMut(&Self::Item) -> R, + R: Try<Output = bool>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns +the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the +specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the +specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
where + FromA: Default + Extend<A>, + FromB: Default + Extend<B>, + Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>
where + T: 'a + Copy, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>
where + T: 'a + Clone, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
1.0.0 · source§

fn cycle(self) -> Cycle<Self>
where + Self: Sized + Clone,

Repeats an iterator endlessly. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> S
where + Self: Sized, + S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> P
where + Self: Sized, + P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Lexicographically compares the PartialOrd elements of +this Iterator with those of another. The comparison works like short-circuit +evaluation, returning a result without comparing the remaining elements. +As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are equal to those of +another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> bool
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are not equal to those of +another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> bool
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> K, + K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Iter<'a>

§

impl<'a> !Send for Iter<'a>

§

impl<'a> !Sync for Iter<'a>

§

impl<'a> Unpin for Iter<'a>

§

impl<'a> UnwindSafe for Iter<'a>

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<I> IntoIterator for I
where + I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
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, 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.
\ No newline at end of file diff --git a/curl/easy/struct.List.html b/curl/easy/struct.List.html new file mode 100644 index 000000000..a19be5a74 --- /dev/null +++ b/curl/easy/struct.List.html @@ -0,0 +1,16 @@ +List in curl::easy - Rust +

Struct curl::easy::List

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

A linked list of a strings

+

Implementations§

source§

impl List

source

pub fn new() -> List

Creates a new empty list of strings.

+
source

pub fn append(&mut self, data: &str) -> Result<(), Error>

Appends some data into this list.

+
source

pub fn iter(&self) -> Iter<'_>

Returns an iterator over the nodes in this list.

+

Trait Implementations§

source§

impl Debug for List

source§

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

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

impl Drop for List

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a> IntoIterator for &'a List

§

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?
§

type Item = &'a [u8]

The type of the elements being iterated over.
source§

fn into_iter(self) -> Iter<'a>

Creates an iterator from a value. Read more
source§

impl Send for List

Auto Trait Implementations§

§

impl RefUnwindSafe for List

§

impl !Sync for List

§

impl Unpin for List

§

impl UnwindSafe for List

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, 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.
\ No newline at end of file diff --git a/curl/easy/struct.Part.html b/curl/easy/struct.Part.html new file mode 100644 index 000000000..c8b6b20f7 --- /dev/null +++ b/curl/easy/struct.Part.html @@ -0,0 +1,64 @@ +Part in curl::easy - Rust +

Struct curl::easy::Part

source ·
pub struct Part<'form, 'data> { /* private fields */ }
Expand description

One part in a multipart upload, added to a Form.

+

Implementations§

source§

impl<'form, 'data> Part<'form, 'data>

source

pub fn contents(&mut self, contents: &'data [u8]) -> &mut Self

A pointer to the contents of this part, the actual data to send away.

+
source

pub fn file_content<P>(&mut self, file: P) -> &mut Self
where + P: AsRef<Path>,

Causes this file to be read and its contents used as data in this part

+

This part does not automatically become a file upload part simply +because its data was read from a file.

+
Errors
+

If the filename has any internal nul bytes or if on Windows it does not +contain a unicode filename then the add function will eventually +return an error.

+
source

pub fn file<P>(&mut self, file: &'data P) -> &mut Self
where + P: AsRef<Path> + ?Sized,

Makes this part a file upload part of the given file.

+

Sets the filename field to the basename of the provided file name, and +it reads the contents of the file and passes them as data and sets the +content type if the given file matches one of the internally known file +extensions.

+

The given upload file must exist entirely on the filesystem before the +upload is started because libcurl needs to read the size of it +beforehand.

+

Multiple files can be uploaded by calling this method multiple times and +content types can also be configured for each file (by calling that +next).

+
Errors
+

If the filename has any internal nul bytes or if on Windows it does not +contain a unicode filename then this function will cause add to return +an error when called.

+
source

pub fn content_type(&mut self, content_type: &'data str) -> &mut Self

Used in combination with Part::file, provides the content-type for +this part, possibly instead of choosing an internal one.

+
Panics
+

This function will panic if content_type contains an internal nul +byte.

+
source

pub fn filename<P>(&mut self, name: &'data P) -> &mut Self
where + P: AsRef<Path> + ?Sized,

Used in combination with Part::file, provides the filename for +this part instead of the actual one.

+
Errors
+

If name contains an internal nul byte, or if on Windows the path is +not valid unicode then this function will return an error when add is +called.

+
source

pub fn buffer<P>(&mut self, name: &'data P, data: Vec<u8>) -> &mut Self
where + P: AsRef<Path> + ?Sized,

This is used to provide a custom file upload part without using the +file method above.

+

The first parameter is for the filename field and the second is the +in-memory contents.

+
Errors
+

If name contains an internal nul byte, or if on Windows the path is +not valid unicode then this function will return an error when add is +called.

+
source

pub fn content_header(&mut self, headers: List) -> &mut Self

Specifies extra headers for the form POST section.

+

Appends the list of headers to those libcurl automatically generates.

+
source

pub fn add(&mut self) -> Result<(), FormError>

Attempts to add this part to the Form that it was created from.

+

If any error happens while adding, that error is returned, otherwise +Ok(()) is returned.

+

Trait Implementations§

source§

impl<'form, 'data> Debug for Part<'form, 'data>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'form, 'data> RefUnwindSafe for Part<'form, 'data>

§

impl<'form, 'data> !Send for Part<'form, 'data>

§

impl<'form, 'data> !Sync for Part<'form, 'data>

§

impl<'form, 'data> Unpin for Part<'form, 'data>

§

impl<'form, 'data> !UnwindSafe for Part<'form, 'data>

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, 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.
\ No newline at end of file diff --git a/curl/easy/struct.PostRedirections.html b/curl/easy/struct.PostRedirections.html new file mode 100644 index 000000000..531068f3e --- /dev/null +++ b/curl/easy/struct.PostRedirections.html @@ -0,0 +1,26 @@ +PostRedirections in curl::easy - Rust +

Struct curl::easy::PostRedirections

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

Structure which stores possible post redirection options to pass to post_redirections.

+

Implementations§

source§

impl PostRedirections

source

pub fn new() -> PostRedirections

Create an empty PostRedirection setting with no flags set.

+
source

pub fn redirect_301(&mut self, on: bool) -> &mut PostRedirections

Configure POST method behaviour on a 301 redirect. Setting the value +to true will preserve the method when following the redirect, else +the method is changed to GET.

+
source

pub fn redirect_302(&mut self, on: bool) -> &mut PostRedirections

Configure POST method behaviour on a 302 redirect. Setting the value +to true will preserve the method when following the redirect, else +the method is changed to GET.

+
source

pub fn redirect_303(&mut self, on: bool) -> &mut PostRedirections

Configure POST method behaviour on a 303 redirect. Setting the value +to true will preserve the method when following the redirect, else +the method is changed to GET.

+
source

pub fn redirect_all(&mut self, on: bool) -> &mut PostRedirections

Configure POST method behaviour for all redirects. Setting the value +to true will preserve the method when following the redirect, else +the method is changed to GET.

+

Trait Implementations§

source§

impl Debug for PostRedirections

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/easy/struct.SslOpt.html b/curl/easy/struct.SslOpt.html new file mode 100644 index 000000000..ddf53135a --- /dev/null +++ b/curl/easy/struct.SslOpt.html @@ -0,0 +1,49 @@ +SslOpt in curl::easy - Rust +

Struct curl::easy::SslOpt

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

Structure which stores possible ssl options to pass to ssl_options.

+

Implementations§

source§

impl SslOpt

source

pub fn new() -> SslOpt

Creates a new set of SSL options.

+
source

pub fn auto_client_cert(&mut self, on: bool) -> &mut SslOpt

Tell libcurl to automatically locate and use a client certificate for authentication, +when requested by the server.

+

This option is only supported for Schannel (the native Windows SSL library). +Prior to 7.77.0 this was the default behavior in libcurl with Schannel.

+

Since the server can request any certificate that supports client authentication in +the OS certificate store it could be a privacy violation and unexpected. (Added in 7.77.0)

+
source

pub fn native_ca(&mut self, on: bool) -> &mut SslOpt

Tell libcurl to use the operating system’s native CA store for certificate verification.

+

Works only on Windows when built to use OpenSSL.

+

This option is experimental and behavior is subject to change. (Added in 7.71.0)

+
source

pub fn revoke_best_effort(&mut self, on: bool) -> &mut SslOpt

Tells libcurl to ignore certificate revocation checks in case of missing or +offline distribution points for those SSL backends where such behavior is present.

+

This option is only supported for Schannel (the native Windows SSL library).

+

If combined with CURLSSLOPT_NO_REVOKE, the latter takes precedence. (Added in 7.70.0)

+
source

pub fn no_partial_chain(&mut self, on: bool) -> &mut SslOpt

Tells libcurl to not accept “partial” certificate chains, which it otherwise does by default.

+

This option is only supported for OpenSSL and will fail the certificate verification +if the chain ends with an intermediate certificate and not with a root cert. +(Added in 7.68.0)

+
source

pub fn no_revoke(&mut self, on: bool) -> &mut SslOpt

Tells libcurl to disable certificate revocation checks for those SSL +backends where such behavior is present.

+

Currently this option is only supported for WinSSL (the native Windows +SSL library), with an exception in the case of Windows’ Untrusted +Publishers blacklist which it seems can’t be bypassed. This option may +have broader support to accommodate other SSL backends in the future. +https://curl.haxx.se/docs/ssl-compared.html

+
source

pub fn allow_beast(&mut self, on: bool) -> &mut SslOpt

Tells libcurl to not attempt to use any workarounds for a security flaw +in the SSL3 and TLS1.0 protocols.

+

If this option isn’t used or this bit is set to 0, the SSL layer libcurl +uses may use a work-around for this flaw although it might cause +interoperability problems with some (older) SSL implementations.

+
+

WARNING: avoiding this work-around lessens the security, and by +setting this option to 1 you ask for exactly that. This option is only +supported for DarwinSSL, NSS and OpenSSL.

+
+

Trait Implementations§

source§

impl Clone for SslOpt

source§

fn clone(&self) -> SslOpt

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 SslOpt

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/easy/struct.Transfer.html b/curl/easy/struct.Transfer.html new file mode 100644 index 000000000..28b80f6c3 --- /dev/null +++ b/curl/easy/struct.Transfer.html @@ -0,0 +1,46 @@ +Transfer in curl::easy - Rust +

Struct curl::easy::Transfer

source ·
pub struct Transfer<'easy, 'data> { /* private fields */ }
Expand description

A scoped transfer of information which borrows an Easy and allows +referencing stack-local data of the lifetime 'data.

+

Usage of Easy requires the 'static and Send bounds on all callbacks +registered, but that’s not often wanted if all you need is to collect a +bunch of data in memory to a vector, for example. The Transfer structure, +created by the Easy::transfer method, is used for this sort of request.

+

The callbacks attached to a Transfer are only active for that one transfer +object, and they allow to elide both the Send and 'static bounds to +close over stack-local information.

+

Implementations§

source§

impl<'easy, 'data> Transfer<'easy, 'data>

source

pub fn write_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(&[u8]) -> Result<usize, WriteError> + 'data,

Same as Easy::write_function, just takes a non 'static lifetime +corresponding to the lifetime of this transfer.

+
source

pub fn read_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(&mut [u8]) -> Result<usize, ReadError> + 'data,

Same as Easy::read_function, just takes a non 'static lifetime +corresponding to the lifetime of this transfer.

+
source

pub fn seek_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(SeekFrom) -> SeekResult + 'data,

Same as Easy::seek_function, just takes a non 'static lifetime +corresponding to the lifetime of this transfer.

+
source

pub fn progress_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(f64, f64, f64, f64) -> bool + 'data,

Same as Easy::progress_function, just takes a non 'static lifetime +corresponding to the lifetime of this transfer.

+
source

pub fn ssl_ctx_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(*mut c_void) -> Result<(), Error> + Send + 'data,

Same as Easy::ssl_ctx_function, just takes a non 'static +lifetime corresponding to the lifetime of this transfer.

+
source

pub fn debug_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(InfoType, &[u8]) + 'data,

Same as Easy::debug_function, just takes a non 'static lifetime +corresponding to the lifetime of this transfer.

+
source

pub fn header_function<F>(&mut self, f: F) -> Result<(), Error>
where + F: FnMut(&[u8]) -> bool + 'data,

Same as Easy::header_function, just takes a non 'static lifetime +corresponding to the lifetime of this transfer.

+
source

pub fn perform(&self) -> Result<(), Error>

Same as Easy::perform.

+
source

pub fn upkeep(&self) -> Result<(), Error>

Same as Easy::upkeep

+
source

pub fn unpause_read(&self) -> Result<(), Error>

Same as Easy::unpause_read.

+
source

pub fn unpause_write(&self) -> Result<(), Error>

Same as Easy::unpause_write

+

Trait Implementations§

source§

impl<'easy, 'data> Debug for Transfer<'easy, 'data>

source§

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

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

impl<'easy, 'data> Drop for Transfer<'easy, 'data>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'easy, 'data> !RefUnwindSafe for Transfer<'easy, 'data>

§

impl<'easy, 'data> !Send for Transfer<'easy, 'data>

§

impl<'easy, 'data> !Sync for Transfer<'easy, 'data>

§

impl<'easy, 'data> Unpin for Transfer<'easy, 'data>

§

impl<'easy, 'data> !UnwindSafe for Transfer<'easy, 'data>

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, 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.
\ No newline at end of file diff --git a/curl/easy/trait.Handler.html b/curl/easy/trait.Handler.html new file mode 100644 index 000000000..979a655b3 --- /dev/null +++ b/curl/easy/trait.Handler.html @@ -0,0 +1,208 @@ +Handler in curl::easy - Rust +

Trait curl::easy::Handler

source ·
pub trait Handler {
+    // Provided methods
+    fn write(&mut self, data: &[u8]) -> Result<usize, WriteError> { ... }
+    fn read(&mut self, data: &mut [u8]) -> Result<usize, ReadError> { ... }
+    fn seek(&mut self, whence: SeekFrom) -> SeekResult { ... }
+    fn debug(&mut self, kind: InfoType, data: &[u8]) { ... }
+    fn header(&mut self, data: &[u8]) -> bool { ... }
+    fn progress(
+        &mut self,
+        dltotal: f64,
+        dlnow: f64,
+        ultotal: f64,
+        ulnow: f64
+    ) -> bool { ... }
+    fn ssl_ctx(&mut self, cx: *mut c_void) -> Result<(), Error> { ... }
+    fn open_socket(
+        &mut self,
+        family: c_int,
+        socktype: c_int,
+        protocol: c_int
+    ) -> Option<curl_socket_t> { ... }
+}
Expand description

A trait for the various callbacks used by libcurl to invoke user code.

+

This trait represents all operations that libcurl can possibly invoke a +client for code during an HTTP transaction. Each callback has a default +“noop” implementation, the same as in libcurl. Types implementing this trait +may simply override the relevant functions to learn about the callbacks +they’re interested in.

+

Examples

+
use curl::easy::{Easy2, Handler, WriteError};
+
+struct Collector(Vec<u8>);
+
+impl Handler for Collector {
+    fn write(&mut self, data: &[u8]) -> Result<usize, WriteError> {
+        self.0.extend_from_slice(data);
+        Ok(data.len())
+    }
+}
+
+let mut easy = Easy2::new(Collector(Vec::new()));
+easy.get(true).unwrap();
+easy.url("https://www.rust-lang.org/").unwrap();
+easy.perform().unwrap();
+
+assert_eq!(easy.response_code().unwrap(), 200);
+let contents = easy.get_ref();
+println!("{}", String::from_utf8_lossy(&contents.0));
+

Provided Methods§

source

fn write(&mut self, data: &[u8]) -> Result<usize, WriteError>

Callback invoked whenever curl has downloaded data for the application.

+

This callback function gets called by libcurl as soon as there is data +received that needs to be saved.

+

The callback function will be passed as much data as possible in all +invokes, but you must not make any assumptions. It may be one byte, it +may be thousands. If show_header is enabled, which makes header data +get passed to the write callback, you can get up to +CURL_MAX_HTTP_HEADER bytes of header data passed into it. This +usually means 100K.

+

This function may be called with zero bytes data if the transferred file +is empty.

+

The callback should return the number of bytes actually taken care of. +If that amount differs from the amount passed to your callback function, +it’ll signal an error condition to the library. This will cause the +transfer to get aborted and the libcurl function used will return +an error with is_write_error.

+

If your callback function returns Err(WriteError::Pause) it will cause +this transfer to become paused. See unpause_write for further details.

+

By default data is sent into the void, and this corresponds to the +CURLOPT_WRITEFUNCTION and CURLOPT_WRITEDATA options.

+
source

fn read(&mut self, data: &mut [u8]) -> Result<usize, ReadError>

Read callback for data uploads.

+

This callback function gets called by libcurl as soon as it needs to +read data in order to send it to the peer - like if you ask it to upload +or post data to the server.

+

Your function must then return the actual number of bytes that it stored +in that memory area. Returning 0 will signal end-of-file to the library +and cause it to stop the current transfer.

+

If you stop the current transfer by returning 0 “pre-maturely” (i.e +before the server expected it, like when you’ve said you will upload N +bytes and you upload less than N bytes), you may experience that the +server “hangs” waiting for the rest of the data that won’t come.

+

The read callback may return Err(ReadError::Abort) to stop the +current operation immediately, resulting in a is_aborted_by_callback +error code from the transfer.

+

The callback can return Err(ReadError::Pause) to cause reading from +this connection to pause. See unpause_read for further details.

+

By default data not input, and this corresponds to the +CURLOPT_READFUNCTION and CURLOPT_READDATA options.

+

Note that the lifetime bound on this function is 'static, but that +is often too restrictive. To use stack data consider calling the +transfer method and then using read_function to configure a +callback that can reference stack-local data.

+
source

fn seek(&mut self, whence: SeekFrom) -> SeekResult

User callback for seeking in input stream.

+

This function gets called by libcurl to seek to a certain position in +the input stream and can be used to fast forward a file in a resumed +upload (instead of reading all uploaded bytes with the normal read +function/callback). It is also called to rewind a stream when data has +already been sent to the server and needs to be sent again. This may +happen when doing a HTTP PUT or POST with a multi-pass authentication +method, or when an existing HTTP connection is reused too late and the +server closes the connection.

+

The callback function must return SeekResult::Ok on success, +SeekResult::Fail to cause the upload operation to fail or +SeekResult::CantSeek to indicate that while the seek failed, libcurl +is free to work around the problem if possible. The latter can sometimes +be done by instead reading from the input or similar.

+

By default data this option is not set, and this corresponds to the +CURLOPT_SEEKFUNCTION and CURLOPT_SEEKDATA options.

+
source

fn debug(&mut self, kind: InfoType, data: &[u8])

Specify a debug callback

+

debug_function replaces the standard debug function used when +verbose is in effect. This callback receives debug information, +as specified in the type argument.

+

By default this option is not set and corresponds to the +CURLOPT_DEBUGFUNCTION and CURLOPT_DEBUGDATA options.

+
source

fn header(&mut self, data: &[u8]) -> bool

Callback that receives header data

+

This function gets called by libcurl as soon as it has received header +data. The header callback will be called once for each header and only +complete header lines are passed on to the callback. Parsing headers is +very easy using this. If this callback returns false it’ll signal an +error to the library. This will cause the transfer to get aborted and +the libcurl function in progress will return is_write_error.

+

A complete HTTP header that is passed to this function can be up to +CURL_MAX_HTTP_HEADER (100K) bytes.

+

It’s important to note that the callback will be invoked for the headers +of all responses received after initiating a request and not just the +final response. This includes all responses which occur during +authentication negotiation. If you need to operate on only the headers +from the final response, you will need to collect headers in the +callback yourself and use HTTP status lines, for example, to delimit +response boundaries.

+

When a server sends a chunked encoded transfer, it may contain a +trailer. That trailer is identical to a HTTP header and if such a +trailer is received it is passed to the application using this callback +as well. There are several ways to detect it being a trailer and not an +ordinary header: 1) it comes after the response-body. 2) it comes after +the final header line (CR LF) 3) a Trailer: header among the regular +response-headers mention what header(s) to expect in the trailer.

+

For non-HTTP protocols like FTP, POP3, IMAP and SMTP this function will +get called with the server responses to the commands that libcurl sends.

+

By default this option is not set and corresponds to the +CURLOPT_HEADERFUNCTION and CURLOPT_HEADERDATA options.

+
source

fn progress( + &mut self, + dltotal: f64, + dlnow: f64, + ultotal: f64, + ulnow: f64 +) -> bool

Callback to progress meter function

+

This function gets called by libcurl instead of its internal equivalent +with a frequent interval. While data is being transferred it will be +called very frequently, and during slow periods like when nothing is +being transferred it can slow down to about one call per second.

+

The callback gets told how much data libcurl will transfer and has +transferred, in number of bytes. The first argument is the total number +of bytes libcurl expects to download in this transfer. The second +argument is the number of bytes downloaded so far. The third argument is +the total number of bytes libcurl expects to upload in this transfer. +The fourth argument is the number of bytes uploaded so far.

+

Unknown/unused argument values passed to the callback will be set to +zero (like if you only download data, the upload size will remain 0). +Many times the callback will be called one or more times first, before +it knows the data sizes so a program must be made to handle that.

+

Returning false from this callback will cause libcurl to abort the +transfer and return is_aborted_by_callback.

+

If you transfer data with the multi interface, this function will not be +called during periods of idleness unless you call the appropriate +libcurl function that performs transfers.

+

progress must be set to true to make this function actually get +called.

+

By default this function calls an internal method and corresponds to +CURLOPT_PROGRESSFUNCTION and CURLOPT_PROGRESSDATA.

+
source

fn ssl_ctx(&mut self, cx: *mut c_void) -> Result<(), Error>

Callback to SSL context

+

This callback function gets called by libcurl just before the +initialization of an SSL connection after having processed all +other SSL related options to give a last chance to an +application to modify the behaviour of the SSL +initialization. The ssl_ctx parameter is actually a pointer +to the SSL library’s SSL_CTX. If an error is returned from the +callback no attempt to establish a connection is made and the +perform operation will return the callback’s error code.

+

This function will get called on all new connections made to a +server, during the SSL negotiation. The SSL_CTX pointer will +be a new one every time.

+

To use this properly, a non-trivial amount of knowledge of +your SSL library is necessary. For example, you can use this +function to call library-specific callbacks to add additional +validation code for certificates, and even to change the +actual URI of a HTTPS request.

+

By default this function calls an internal method and +corresponds to CURLOPT_SSL_CTX_FUNCTION and +CURLOPT_SSL_CTX_DATA.

+

Note that this callback is not guaranteed to be called, not all versions +of libcurl support calling this callback.

+
source

fn open_socket( + &mut self, + family: c_int, + socktype: c_int, + protocol: c_int +) -> Option<curl_socket_t>

Callback to open sockets for libcurl.

+

This callback function gets called by libcurl instead of the socket(2) +call. The callback function should return the newly created socket +or None in case no connection could be established or another +error was detected. Any additional setsockopt(2) calls can of course +be done on the socket at the user’s discretion. A None return +value from the callback function will signal an unrecoverable error to +libcurl and it will return is_couldnt_connect from the function that +triggered this callback.

+

By default this function opens a standard socket and +corresponds to CURLOPT_OPENSOCKETFUNCTION .

+

Implementors§

\ No newline at end of file diff --git a/curl/error/struct.Error.html b/curl/error/struct.Error.html new file mode 100644 index 000000000..3990b48e0 --- /dev/null +++ b/curl/error/struct.Error.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../curl/struct.Error.html...

+ + + \ No newline at end of file diff --git a/curl/error/struct.FormError.html b/curl/error/struct.FormError.html new file mode 100644 index 000000000..c923789ad --- /dev/null +++ b/curl/error/struct.FormError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../curl/struct.FormError.html...

+ + + \ No newline at end of file diff --git a/curl/error/struct.MultiError.html b/curl/error/struct.MultiError.html new file mode 100644 index 000000000..a4cb019f3 --- /dev/null +++ b/curl/error/struct.MultiError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../curl/struct.MultiError.html...

+ + + \ No newline at end of file diff --git a/curl/error/struct.ShareError.html b/curl/error/struct.ShareError.html new file mode 100644 index 000000000..c698a9120 --- /dev/null +++ b/curl/error/struct.ShareError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../curl/struct.ShareError.html...

+ + + \ No newline at end of file diff --git a/curl/fn.init.html b/curl/fn.init.html new file mode 100644 index 000000000..7757fc381 --- /dev/null +++ b/curl/fn.init.html @@ -0,0 +1,15 @@ +init in curl - Rust +

Function curl::init

source ·
pub fn init()
Expand description

Initializes the underlying libcurl library.

+

The underlying libcurl library must be initialized before use, and must be +done so on the main thread before any other threads are created by the +program. This crate will do this for you automatically in the following +scenarios:

+
    +
  • Creating a new Easy or Multi handle
  • +
  • At program startup on Windows, macOS, Linux, Android, or FreeBSD systems
  • +
+

This should be sufficient for most applications and scenarios, but in any +other case, it is strongly recommended that you call this function manually +as soon as your program starts.

+

Calling this function more than once is harmless and has no effect.

+
\ No newline at end of file diff --git a/curl/index.html b/curl/index.html new file mode 100644 index 000000000..036c13a14 --- /dev/null +++ b/curl/index.html @@ -0,0 +1,43 @@ +curl - Rust +

Crate curl

source ·
Expand description

Rust bindings to the libcurl C library

+

This crate contains bindings for an HTTP/HTTPS client which is powered by +libcurl, the same library behind the curl command line tool. The API +currently closely matches that of libcurl itself, except that a Rustic layer +of safety is applied on top.

+

The “Easy” API

+

The easiest way to send a request is to use the Easy api which corresponds +to CURL in libcurl. This handle supports a wide variety of options and can +be used to make a single blocking request in a thread. Callbacks can be +specified to deal with data as it arrives and a handle can be reused to +cache connections and such.

+ +
use std::io::{stdout, Write};
+
+use curl::easy::Easy;
+
+// Write the contents of rust-lang.org to stdout
+let mut easy = Easy::new();
+easy.url("https://www.rust-lang.org/").unwrap();
+easy.write_function(|data| {
+    stdout().write_all(data).unwrap();
+    Ok(data.len())
+}).unwrap();
+easy.perform().unwrap();
+

What about multiple concurrent HTTP requests?

+

One option you have currently is to send multiple requests in multiple +threads, but otherwise libcurl has a “multi” interface for doing this +operation. Initial bindings of this interface can be found in the multi +module, but feedback is welcome!

+

Where does libcurl come from?

+

This crate links to the curl-sys crate which is in turn responsible for +acquiring and linking to the libcurl library. Currently this crate will +build libcurl from source if one is not already detected on the system.

+

There is a large number of releases for libcurl, all with different sets of +capabilities. Robust programs may wish to inspect Version::get() to test +what features are implemented in the linked build of libcurl at runtime.

+

Initialization

+

The underlying libcurl library must be initialized before use and has +certain requirements on how this is done. Check the documentation for +init for more details.

+

Modules

  • Bindings to the “easy” libcurl API.
  • Multi - initiating multiple requests simultaneously

Structs

  • An error returned from various “easy” operations.
  • An error from “form add” operations.
  • An error from “multi” operations.
  • An iterator over the list of protocols a version supports.
  • An error returned from “share” operations.
  • Version information about libcurl and the capabilities that it supports.

Functions

  • Initializes the underlying libcurl library.
\ No newline at end of file diff --git a/curl/multi/index.html b/curl/multi/index.html new file mode 100644 index 000000000..70ad9341b --- /dev/null +++ b/curl/multi/index.html @@ -0,0 +1,4 @@ +curl::multi - Rust +

Module curl::multi

source ·
Expand description

Multi - initiating multiple requests simultaneously

+

Structs

  • Wrapper around an easy handle while it’s owned by a multi handle.
  • Wrapper around an easy handle while it’s owned by a multi handle.
  • Notification of the events that have happened on a socket.
  • Message from the messages function of a multi handle.
  • A multi handle for initiating multiple connections simultaneously.
  • A handle that can be used to wake up a thread that’s blocked in Multi::poll. +The handle can be passed to and used from any thread.
  • Notification of events that are requested on a socket.
  • File descriptor to wait on for use with the wait method on a multi handle.

Type Aliases

  • Raw underlying socket type that the multi handles use
\ No newline at end of file diff --git a/curl/multi/sidebar-items.js b/curl/multi/sidebar-items.js new file mode 100644 index 000000000..dbe933e49 --- /dev/null +++ b/curl/multi/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Easy2Handle","EasyHandle","Events","Message","Multi","MultiWaker","SocketEvents","WaitFd"],"type":["Socket"]}; \ No newline at end of file diff --git a/curl/multi/struct.Easy2Handle.html b/curl/multi/struct.Easy2Handle.html new file mode 100644 index 000000000..ddd330376 --- /dev/null +++ b/curl/multi/struct.Easy2Handle.html @@ -0,0 +1,63 @@ +Easy2Handle in curl::multi - Rust +

Struct curl::multi::Easy2Handle

source ·
pub struct Easy2Handle<H> { /* private fields */ }
Expand description

Wrapper around an easy handle while it’s owned by a multi handle.

+

Once an easy handle has been added to a multi handle then it can no longer +be used via perform. This handle is also used to remove the easy handle +from the multi handle when desired.

+

Implementations§

source§

impl<H> Easy2Handle<H>

source

pub fn get_ref(&self) -> &H

Acquires a reference to the underlying handler for events.

+
source

pub fn get_mut(&mut self) -> &mut H

Acquires a reference to the underlying handler for events.

+
source

pub fn set_token(&mut self, token: usize) -> Result<(), Error>

Same as EasyHandle::set_token

+
source

pub fn time_condition_unmet(&mut self) -> Result<bool, Error>

source

pub fn effective_url(&mut self) -> Result<Option<&str>, Error>

source

pub fn effective_url_bytes(&mut self) -> Result<Option<&[u8]>, Error>

source

pub fn response_code(&mut self) -> Result<u32, Error>

source

pub fn http_connectcode(&mut self) -> Result<u32, Error>

source

pub fn filetime(&mut self) -> Result<Option<i64>, Error>

Same as Easy2::filetime.

+
source

pub fn download_size(&mut self) -> Result<f64, Error>

source

pub fn content_length_download(&mut self) -> Result<f64, Error>

source

pub fn total_time(&mut self) -> Result<Duration, Error>

source

pub fn namelookup_time(&mut self) -> Result<Duration, Error>

source

pub fn connect_time(&mut self) -> Result<Duration, Error>

source

pub fn appconnect_time(&mut self) -> Result<Duration, Error>

source

pub fn pretransfer_time(&mut self) -> Result<Duration, Error>

source

pub fn starttransfer_time(&mut self) -> Result<Duration, Error>

source

pub fn redirect_time(&mut self) -> Result<Duration, Error>

source

pub fn redirect_count(&mut self) -> Result<u32, Error>

source

pub fn redirect_url(&mut self) -> Result<Option<&str>, Error>

source

pub fn redirect_url_bytes(&mut self) -> Result<Option<&[u8]>, Error>

source

pub fn header_size(&mut self) -> Result<u64, Error>

source

pub fn request_size(&mut self) -> Result<u64, Error>

source

pub fn content_type(&mut self) -> Result<Option<&str>, Error>

source

pub fn content_type_bytes(&mut self) -> Result<Option<&[u8]>, Error>

source

pub fn os_errno(&mut self) -> Result<i32, Error>

Same as Easy2::os_errno.

+
source

pub fn primary_ip(&mut self) -> Result<Option<&str>, Error>

source

pub fn primary_port(&mut self) -> Result<u16, Error>

source

pub fn local_ip(&mut self) -> Result<Option<&str>, Error>

Same as Easy2::local_ip.

+
source

pub fn local_port(&mut self) -> Result<u16, Error>

source

pub fn cookies(&mut self) -> Result<List, Error>

Same as Easy2::cookies.

+
source

pub fn unpause_read(&self) -> Result<(), Error>

Unpause reading on a connection.

+

Using this function, you can explicitly unpause a connection that was +previously paused.

+

A connection can be paused by letting the read or the write callbacks +return ReadError::Pause or WriteError::Pause.

+

The chance is high that you will get your write callback called before +this function returns.

+
source

pub fn unpause_write(&self) -> Result<(), Error>

Unpause writing on a connection.

+

Using this function, you can explicitly unpause a connection that was +previously paused.

+

A connection can be paused by letting the read or the write callbacks +return ReadError::Pause or WriteError::Pause. A write callback that +returns pause signals to the library that it couldn’t take care of any +data at all, and that data will then be delivered again to the callback +when the writing is later unpaused.

+
source

pub fn raw(&self) -> *mut CURL

Get a pointer to the raw underlying CURL handle.

+

Trait Implementations§

source§

impl<H: Debug> Debug for Easy2Handle<H>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<H> !RefUnwindSafe for Easy2Handle<H>

§

impl<H> !Send for Easy2Handle<H>

§

impl<H> !Sync for Easy2Handle<H>

§

impl<H> Unpin for Easy2Handle<H>

§

impl<H> !UnwindSafe for Easy2Handle<H>

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, 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.
\ No newline at end of file diff --git a/curl/multi/struct.EasyHandle.html b/curl/multi/struct.EasyHandle.html new file mode 100644 index 000000000..5fa531192 --- /dev/null +++ b/curl/multi/struct.EasyHandle.html @@ -0,0 +1,63 @@ +EasyHandle in curl::multi - Rust +

Struct curl::multi::EasyHandle

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

Wrapper around an easy handle while it’s owned by a multi handle.

+

Once an easy handle has been added to a multi handle then it can no longer +be used via perform. This handle is also used to remove the easy handle +from the multi handle when desired.

+

Implementations§

source§

impl EasyHandle

source

pub fn set_token(&mut self, token: usize) -> Result<(), Error>

Sets an internal private token for this EasyHandle.

+

This function will set the CURLOPT_PRIVATE field on the underlying +easy handle.

+
source

pub fn time_condition_unmet(&mut self) -> Result<bool, Error>

source

pub fn effective_url(&mut self) -> Result<Option<&str>, Error>

source

pub fn effective_url_bytes(&mut self) -> Result<Option<&[u8]>, Error>

source

pub fn response_code(&mut self) -> Result<u32, Error>

source

pub fn http_connectcode(&mut self) -> Result<u32, Error>

source

pub fn filetime(&mut self) -> Result<Option<i64>, Error>

Same as Easy2::filetime.

+
source

pub fn download_size(&mut self) -> Result<f64, Error>

source

pub fn content_length_download(&mut self) -> Result<f64, Error>

source

pub fn total_time(&mut self) -> Result<Duration, Error>

source

pub fn namelookup_time(&mut self) -> Result<Duration, Error>

source

pub fn connect_time(&mut self) -> Result<Duration, Error>

source

pub fn appconnect_time(&mut self) -> Result<Duration, Error>

source

pub fn pretransfer_time(&mut self) -> Result<Duration, Error>

source

pub fn starttransfer_time(&mut self) -> Result<Duration, Error>

source

pub fn redirect_time(&mut self) -> Result<Duration, Error>

source

pub fn redirect_count(&mut self) -> Result<u32, Error>

source

pub fn redirect_url(&mut self) -> Result<Option<&str>, Error>

source

pub fn redirect_url_bytes(&mut self) -> Result<Option<&[u8]>, Error>

source

pub fn header_size(&mut self) -> Result<u64, Error>

source

pub fn request_size(&mut self) -> Result<u64, Error>

source

pub fn content_type(&mut self) -> Result<Option<&str>, Error>

source

pub fn content_type_bytes(&mut self) -> Result<Option<&[u8]>, Error>

source

pub fn os_errno(&mut self) -> Result<i32, Error>

Same as Easy2::os_errno.

+
source

pub fn primary_ip(&mut self) -> Result<Option<&str>, Error>

source

pub fn primary_port(&mut self) -> Result<u16, Error>

source

pub fn local_ip(&mut self) -> Result<Option<&str>, Error>

Same as Easy2::local_ip.

+
source

pub fn local_port(&mut self) -> Result<u16, Error>

source

pub fn cookies(&mut self) -> Result<List, Error>

Same as Easy2::cookies.

+
source

pub fn unpause_read(&self) -> Result<(), Error>

Unpause reading on a connection.

+

Using this function, you can explicitly unpause a connection that was +previously paused.

+

A connection can be paused by letting the read or the write callbacks +return ReadError::Pause or WriteError::Pause.

+

The chance is high that you will get your write callback called before +this function returns.

+
source

pub fn unpause_write(&self) -> Result<(), Error>

Unpause writing on a connection.

+

Using this function, you can explicitly unpause a connection that was +previously paused.

+

A connection can be paused by letting the read or the write callbacks +return ReadError::Pause or WriteError::Pause. A write callback that +returns pause signals to the library that it couldn’t take care of any +data at all, and that data will then be delivered again to the callback +when the writing is later unpaused.

+
source

pub fn raw(&self) -> *mut CURL

Get a pointer to the raw underlying CURL handle.

+

Trait Implementations§

source§

impl Debug for EasyHandle

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/multi/struct.Events.html b/curl/multi/struct.Events.html new file mode 100644 index 000000000..4b61e85ec --- /dev/null +++ b/curl/multi/struct.Events.html @@ -0,0 +1,20 @@ +Events in curl::multi - Rust +

Struct curl::multi::Events

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

Notification of the events that have happened on a socket.

+

This type is passed as an argument to the action method on a multi handle +to indicate what events have occurred on a socket.

+

Implementations§

source§

impl Events

source

pub fn new() -> Events

Creates a new blank event bit mask.

+
source

pub fn input(&mut self, val: bool) -> &mut Events

Set or unset the whether these events indicate that input is ready.

+
source

pub fn output(&mut self, val: bool) -> &mut Events

Set or unset the whether these events indicate that output is ready.

+
source

pub fn error(&mut self, val: bool) -> &mut Events

Set or unset the whether these events indicate that an error has +happened.

+

Trait Implementations§

source§

impl Debug for Events

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/multi/struct.Message.html b/curl/multi/struct.Message.html new file mode 100644 index 000000000..b02fbd6a7 --- /dev/null +++ b/curl/multi/struct.Message.html @@ -0,0 +1,40 @@ +Message in curl::multi - Rust +

Struct curl::multi::Message

source ·
pub struct Message<'multi> { /* private fields */ }
Expand description

Message from the messages function of a multi handle.

+

Currently only indicates whether a transfer is done.

+

Implementations§

source§

impl<'multi> Message<'multi>

source

pub fn result(&self) -> Option<Result<(), Error>>

If this message indicates that a transfer has finished, returns the +result of the transfer in Some.

+

If the message doesn’t indicate that a transfer has finished, then +None is returned.

+

Note that the result*_for methods below should be preferred as they +provide better error messages as the associated error data on the +handle can be associated with the error type.

+
source

pub fn result_for(&self, handle: &EasyHandle) -> Option<Result<(), Error>>

Same as result, except only returns Some for the specified handle.

+

Note that this function produces better error messages than result as +it uses take_error_buf to associate error information with the +returned error.

+
source

pub fn result_for2<H>( + &self, + handle: &Easy2Handle<H> +) -> Option<Result<(), Error>>

Same as result, except only returns Some for the specified handle.

+

Note that this function produces better error messages than result as +it uses take_error_buf to associate error information with the +returned error.

+
source

pub fn is_for(&self, handle: &EasyHandle) -> bool

Returns whether this easy message was for the specified easy handle or +not.

+
source

pub fn is_for2<H>(&self, handle: &Easy2Handle<H>) -> bool

Same as is_for, but for Easy2Handle.

+
source

pub fn token(&self) -> Result<usize, Error>

Returns the token associated with the easy handle that this message +represents a completion for.

+

This function will return the token assigned with +EasyHandle::set_token. This reads the CURLINFO_PRIVATE field of the +underlying *mut CURL.

+

Trait Implementations§

source§

impl<'a> Debug for Message<'a>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'multi> !RefUnwindSafe for Message<'multi>

§

impl<'multi> !Send for Message<'multi>

§

impl<'multi> !Sync for Message<'multi>

§

impl<'multi> Unpin for Message<'multi>

§

impl<'multi> !UnwindSafe for Message<'multi>

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, 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.
\ No newline at end of file diff --git a/curl/multi/struct.Multi.html b/curl/multi/struct.Multi.html new file mode 100644 index 000000000..fa7261269 --- /dev/null +++ b/curl/multi/struct.Multi.html @@ -0,0 +1,322 @@ +Multi in curl::multi - Rust +

Struct curl::multi::Multi

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

A multi handle for initiating multiple connections simultaneously.

+

This structure corresponds to CURLM in libcurl and provides the ability to +have multiple transfers in flight simultaneously. This handle is then used +to manage each transfer. The main purpose of a CURLM is for the +application to drive the I/O rather than libcurl itself doing all the +blocking. Methods like action allow the application to inform libcurl of +when events have happened.

+

Lots more documentation can be found on the libcurl multi tutorial where +the APIs correspond pretty closely with this crate.

+

Implementations§

source§

impl Multi

source

pub fn new() -> Multi

Creates a new multi session through which multiple HTTP transfers can be +initiated.

+
source

pub fn socket_function<F>(&mut self, f: F) -> Result<(), MultiError>
where + F: FnMut(Socket, SocketEvents, usize) + Send + 'static,

Set the callback informed about what to wait for

+

When the action function runs, it informs the application about +updates in the socket (file descriptor) status by doing none, one, or +multiple calls to the socket callback. The callback gets status updates +with changes since the previous time the callback was called. See +action for more details on how the callback is used and should work.

+

The SocketEvents parameter informs the callback on the status of the +given socket, and the methods on that type can be used to learn about +what’s going on with the socket.

+

The third usize parameter is a custom value set by the assign method +below.

+
source

pub fn assign(&self, socket: Socket, token: usize) -> Result<(), MultiError>

Set data to associate with an internal socket

+

This function creates an association in the multi handle between the +given socket and a private token of the application. This is designed +for action uses.

+

When set, the token will be passed to all future socket callbacks for +the specified socket.

+

If the given socket isn’t already in use by libcurl, this function will +return an error.

+

libcurl only keeps one single token associated with a socket, so +calling this function several times for the same socket will make the +last set token get used.

+

The idea here being that this association (socket to token) is something +that just about every application that uses this API will need and then +libcurl can just as well do it since it already has an internal hash +table lookup for this.

+
Typical Usage
+

In a typical application you allocate a struct or at least use some kind +of semi-dynamic data for each socket that we must wait for action on +when using the action approach.

+

When our socket-callback gets called by libcurl and we get to know about +yet another socket to wait for, we can use assign to point out the +particular data so that when we get updates about this same socket +again, we don’t have to find the struct associated with this socket by +ourselves.

+
source

pub fn timer_function<F>(&mut self, f: F) -> Result<(), MultiError>
where + F: FnMut(Option<Duration>) -> bool + Send + 'static,

Set callback to receive timeout values

+

Certain features, such as timeouts and retries, require you to call +libcurl even when there is no activity on the file descriptors.

+

Your callback function should install a non-repeating timer with the +interval specified. Each time that timer fires, call either action or +perform, depending on which interface you use.

+

A timeout value of None means you should delete your timer.

+

A timeout value of 0 means you should call action or perform (once) +as soon as possible.

+

This callback will only be called when the timeout changes.

+

The timer callback should return true on success, and false on +error. This callback can be used instead of, or in addition to, +get_timeout.

+
source

pub fn pipelining( + &mut self, + http_1: bool, + multiplex: bool +) -> Result<(), MultiError>

Enable or disable HTTP pipelining and multiplexing.

+

When http_1 is true, enable HTTP/1.1 pipelining, which means that if +you add a second request that can use an already existing connection, +the second request will be “piped” on the same connection rather than +being executed in parallel.

+

When multiplex is true, enable HTTP/2 multiplexing, which means that +follow-up requests can re-use an existing connection and send the new +request multiplexed over that at the same time as other transfers are +already using that single connection.

+
source

pub fn set_max_host_connections(&mut self, val: usize) -> Result<(), MultiError>

Sets the max number of connections to a single host.

+

Pass a long to indicate the max number of simultaneously open connections +to a single host (a host being the same as a host name + port number pair). +For each new session to a host, libcurl will open up a new connection up to the +limit set by the provided value. When the limit is reached, the sessions will +be pending until a connection becomes available. If pipelining is enabled, +libcurl will try to pipeline if the host is capable of it.

+
source

pub fn set_max_total_connections( + &mut self, + val: usize +) -> Result<(), MultiError>

Sets the max simultaneously open connections.

+

The set number will be used as the maximum number of simultaneously open +connections in total using this multi handle. For each new session, +libcurl will open a new connection up to the limit set by the provided +value. When the limit is reached, the sessions will be pending until +there are available connections. If pipelining is enabled, libcurl will +try to pipeline or use multiplexing if the host is capable of it.

+
source

pub fn set_max_connects(&mut self, val: usize) -> Result<(), MultiError>

Set size of connection cache.

+

The set number will be used as the maximum amount of simultaneously open +connections that libcurl may keep in its connection cache after +completed use. By default libcurl will enlarge the size for each added +easy handle to make it fit 4 times the number of added easy handles.

+

By setting this option, you can prevent the cache size from growing +beyond the limit set by you.

+

When the cache is full, curl closes the oldest one in the cache to +prevent the number of open connections from increasing.

+

See set_max_total_connections for +limiting the number of active connections.

+
source

pub fn set_pipeline_length(&mut self, val: usize) -> Result<(), MultiError>

Sets the pipeline length.

+

This sets the max number that will be used as the maximum amount of +outstanding requests in an HTTP/1.1 pipelined connection. This option +is only used for HTTP/1.1 pipelining, and not HTTP/2 multiplexing.

+
source

pub fn set_max_concurrent_streams( + &mut self, + val: usize +) -> Result<(), MultiError>

Sets the number of max concurrent streams for http2.

+

This sets the max number will be used as the maximum number of +concurrent streams for a connections that libcurl should support on +connections done using HTTP/2. Defaults to 100.

+
source

pub fn add(&self, easy: Easy) -> Result<EasyHandle, MultiError>

Add an easy handle to a multi session

+

Adds a standard easy handle to the multi stack. This function call will +make this multi handle control the specified easy handle.

+

When an easy interface is added to a multi handle, it will use a shared +connection cache owned by the multi handle. Removing and adding new easy +handles will not affect the pool of connections or the ability to do +connection re-use.

+

If you have timer_function set in the multi handle (and you really +should if you’re working event-based with action and friends), that +callback will be called from within this function to ask for an updated +timer so that your main event loop will get the activity on this handle +to get started.

+

The easy handle will remain added to the multi handle until you remove +it again with remove on the returned handle - even when a transfer +with that specific easy handle is completed.

+
source

pub fn add2<H>(&self, easy: Easy2<H>) -> Result<Easy2Handle<H>, MultiError>

Same as add, but works with the Easy2 type.

+
source

pub fn remove(&self, easy: EasyHandle) -> Result<Easy, MultiError>

Remove an easy handle from this multi session

+

Removes the easy handle from this multi handle. This will make the +returned easy handle be removed from this multi handle’s control.

+

When the easy handle has been removed from a multi stack, it is again +perfectly legal to invoke perform on it.

+

Removing an easy handle while being used is perfectly legal and will +effectively halt the transfer in progress involving that easy handle. +All other easy handles and transfers will remain unaffected.

+
source

pub fn remove2<H>(&self, easy: Easy2Handle<H>) -> Result<Easy2<H>, MultiError>

Same as remove, but for Easy2Handle.

+
source

pub fn messages<F>(&self, f: F)
where + F: FnMut(Message<'_>),

Read multi stack informationals

+

Ask the multi handle if there are any messages/informationals from the +individual transfers. Messages may include informationals such as an +error code from the transfer or just the fact that a transfer is +completed. More details on these should be written down as well.

+
source

pub fn action(&self, socket: Socket, events: &Events) -> Result<u32, MultiError>

Inform of reads/writes available data given an action

+

When the application has detected action on a socket handled by libcurl, +it should call this function with the sockfd argument set to +the socket with the action. When the events on a socket are known, they +can be passed events. When the events on a socket are unknown, pass +Events::new() instead, and libcurl will test the descriptor +internally.

+

The returned integer will contain the number of running easy handles +within the multi handle. When this number reaches zero, all transfers +are complete/done. When you call action on a specific socket and the +counter decreases by one, it DOES NOT necessarily mean that this exact +socket/transfer is the one that completed. Use messages to figure out +which easy handle that completed.

+

The action function informs the application about updates in the +socket (file descriptor) status by doing none, one, or multiple calls to +the socket callback function set with the socket_function method. They +update the status with changes since the previous time the callback was +called.

+
source

pub fn timeout(&self) -> Result<u32, MultiError>

Inform libcurl that a timeout has expired and sockets should be tested.

+

The returned integer will contain the number of running easy handles +within the multi handle. When this number reaches zero, all transfers +are complete/done. When you call action on a specific socket and the +counter decreases by one, it DOES NOT necessarily mean that this exact +socket/transfer is the one that completed. Use messages to figure out +which easy handle that completed.

+

Get the timeout time by calling the timer_function method. Your +application will then get called with information on how long to wait +for socket actions at most before doing the timeout action: call the +timeout method. You can also use the get_timeout function to +poll the value at any given time, but for an event-based system using +the callback is far better than relying on polling the timeout value.

+
source

pub fn get_timeout(&self) -> Result<Option<Duration>, MultiError>

Get how long to wait for action before proceeding

+

An application using the libcurl multi interface should call +get_timeout to figure out how long it should wait for socket actions - +at most - before proceeding.

+

Proceeding means either doing the socket-style timeout action: call the +timeout function, or call perform if you’re using the simpler and +older multi interface approach.

+

The timeout value returned is the duration at this very moment. If 0, it +means you should proceed immediately without waiting for anything. If it +returns None, there’s no timeout at all set.

+

Note: if libcurl returns a None timeout here, it just means that +libcurl currently has no stored timeout value. You must not wait too +long (more than a few seconds perhaps) before you call perform again.

+
source

pub fn wait( + &self, + waitfds: &mut [WaitFd], + timeout: Duration +) -> Result<u32, MultiError>

Block until activity is detected or a timeout passes.

+

The timeout is used in millisecond-precision. Large durations are +clamped at the maximum value curl accepts.

+

The returned integer will contain the number of internal file +descriptors on which interesting events occured.

+

This function is a simpler alternative to using fdset() and select() +and does not suffer from file descriptor limits.

+
Example
+
use curl::multi::Multi;
+use std::time::Duration;
+
+let m = Multi::new();
+
+// Add some Easy handles...
+
+while m.perform().unwrap() > 0 {
+    m.wait(&mut [], Duration::from_secs(1)).unwrap();
+}
+
source

pub fn poll( + &self, + waitfds: &mut [WaitFd], + timeout: Duration +) -> Result<u32, MultiError>

Block until activity is detected or a timeout passes.

+

The timeout is used in millisecond-precision. Large durations are +clamped at the maximum value curl accepts.

+

The returned integer will contain the number of internal file +descriptors on which interesting events occurred.

+

This function is a simpler alternative to using fdset() and select() +and does not suffer from file descriptor limits.

+

While this method is similar to Multi::wait, with the following +distinctions:

+
    +
  • If there are no handles added to the multi, poll will honor the +provided timeout, while Multi::wait returns immediately.
  • +
  • If poll has blocked due to there being no activity on the handles in +the Multi, it can be woken up from any thread and at any time before +the timeout expires.
  • +
+

Requires libcurl 7.66.0 or later.

+
Example
+
use curl::multi::Multi;
+use std::time::Duration;
+
+let m = Multi::new();
+
+// Add some Easy handles...
+
+while m.perform().unwrap() > 0 {
+    m.poll(&mut [], Duration::from_secs(1)).unwrap();
+}
+
source

pub fn waker(&self) -> MultiWaker

Returns a new MultiWaker that can be used to wake up a thread that’s +currently blocked in Multi::poll.

+
source

pub fn perform(&self) -> Result<u32, MultiError>

Reads/writes available data from each easy handle.

+

This function handles transfers on all the added handles that need +attention in an non-blocking fashion.

+

When an application has found out there’s data available for this handle +or a timeout has elapsed, the application should call this function to +read/write whatever there is to read or write right now etc. This +method returns as soon as the reads/writes are done. This function does +not require that there actually is any data available for reading or +that data can be written, it can be called just in case. It will return +the number of handles that still transfer data.

+

If the amount of running handles is changed from the previous call (or +is less than the amount of easy handles you’ve added to the multi +handle), you know that there is one or more transfers less “running”. +You can then call info to get information about each individual +completed transfer, and that returned info includes Error and more. +If an added handle fails very quickly, it may never be counted as a +running handle.

+

When running_handles is set to zero (0) on the return of this function, +there is no longer any transfers in progress.

+
Return
+

Before libcurl version 7.20.0: If you receive is_call_perform, this +basically means that you should call perform again, before you select +on more actions. You don’t have to do it immediately, but the return +code means that libcurl may have more data available to return or that +there may be more data to send off before it is “satisfied”. Do note +that perform will return is_call_perform only when it wants to be +called again immediately. When things are fine and there is nothing +immediate it wants done, it’ll return Ok and you need to wait for +“action” and then call this function again.

+

This function only returns errors etc regarding the whole multi stack. +Problems still might have occurred on individual transfers even when +this function returns Ok. Use info to figure out how individual +transfers did.

+
source

pub fn fdset2( + &self, + read: Option<&mut fd_set>, + write: Option<&mut fd_set>, + except: Option<&mut fd_set> +) -> Result<Option<i32>, MultiError>

Extracts file descriptor information from a multi handle

+

This function extracts file descriptor information from a given +handle, and libcurl returns its fd_set sets. The application can use +these to select() on, but be sure to FD_ZERO them before calling +this function as curl_multi_fdset only adds its own descriptors, it +doesn’t zero or otherwise remove any others. The curl_multi_perform +function should be called as soon as one of them is ready to be read +from or written to.

+

If no file descriptors are set by libcurl, this function will return +Ok(None). Otherwise Ok(Some(n)) will be returned where n the +highest descriptor number libcurl set. When Ok(None) is returned it +is because libcurl currently does something that isn’t possible for +your application to monitor with a socket and unfortunately you can +then not know exactly when the current action is completed using +select(). You then need to wait a while before you proceed and call +perform anyway.

+

When doing select(), you should use get_timeout to figure out +how long to wait for action. Call perform even if no activity has +been seen on the fd_sets after the timeout expires as otherwise +internal retries and timeouts may not work as you’d think and want.

+

If one of the sockets used by libcurl happens to be larger than what +can be set in an fd_set, which on POSIX systems means that the file +descriptor is larger than FD_SETSIZE, then libcurl will try to not +set it. Setting a too large file descriptor in an fd_set implies an out +of bounds write which can cause crashes, or worse. The effect of NOT +storing it will possibly save you from the crash, but will make your +program NOT wait for sockets it should wait for…

+
source

pub fn raw(&self) -> *mut CURLM

Get a pointer to the raw underlying CURLM handle.

+

Trait Implementations§

source§

impl Debug for Multi

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Multi

§

impl !Send for Multi

§

impl !Sync for Multi

§

impl Unpin for Multi

§

impl !UnwindSafe for Multi

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, 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.
\ No newline at end of file diff --git a/curl/multi/struct.MultiWaker.html b/curl/multi/struct.MultiWaker.html new file mode 100644 index 000000000..cf993db57 --- /dev/null +++ b/curl/multi/struct.MultiWaker.html @@ -0,0 +1,19 @@ +MultiWaker in curl::multi - Rust +

Struct curl::multi::MultiWaker

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

A handle that can be used to wake up a thread that’s blocked in Multi::poll. +The handle can be passed to and used from any thread.

+

Implementations§

source§

impl MultiWaker

source

pub fn wakeup(&self) -> Result<(), MultiError>

Wakes up a thread that is blocked in Multi::poll. This method can be +invoked from any thread.

+

Will return an error if the RawMulti has already been dropped.

+

Requires libcurl 7.68.0 or later.

+

Trait Implementations§

source§

impl Clone for MultiWaker

source§

fn clone(&self) -> MultiWaker

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 MultiWaker

source§

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

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

impl Send for MultiWaker

source§

impl Sync for MultiWaker

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/multi/struct.SocketEvents.html b/curl/multi/struct.SocketEvents.html new file mode 100644 index 000000000..3b732b85b --- /dev/null +++ b/curl/multi/struct.SocketEvents.html @@ -0,0 +1,20 @@ +SocketEvents in curl::multi - Rust +

Struct curl::multi::SocketEvents

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

Notification of events that are requested on a socket.

+

This type is yielded to the socket_function callback to indicate what +events are requested on a socket.

+

Implementations§

source§

impl SocketEvents

source

pub fn input(&self) -> bool

Wait for incoming data. For the socket to become readable.

+
source

pub fn output(&self) -> bool

Wait for outgoing data. For the socket to become writable.

+
source

pub fn input_and_output(&self) -> bool

Wait for incoming and outgoing data. For the socket to become readable +or writable.

+
source

pub fn remove(&self) -> bool

The specified socket/file descriptor is no longer used by libcurl.

+

Trait Implementations§

source§

impl Debug for SocketEvents

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/multi/struct.WaitFd.html b/curl/multi/struct.WaitFd.html new file mode 100644 index 000000000..2303859f0 --- /dev/null +++ b/curl/multi/struct.WaitFd.html @@ -0,0 +1,30 @@ +WaitFd in curl::multi - Rust +

Struct curl::multi::WaitFd

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

File descriptor to wait on for use with the wait method on a multi handle.

+

Implementations§

source§

impl WaitFd

source

pub fn new() -> WaitFd

Constructs an empty (invalid) WaitFd.

+
source

pub fn set_fd(&mut self, fd: Socket)

Set the file descriptor to wait for.

+
source

pub fn poll_on_read(&mut self, val: bool) -> &mut WaitFd

Indicate that the socket should poll on read events such as new data +received.

+

Corresponds to CURL_WAIT_POLLIN.

+
source

pub fn poll_on_priority_read(&mut self, val: bool) -> &mut WaitFd

Indicate that the socket should poll on high priority read events such +as out of band data.

+

Corresponds to CURL_WAIT_POLLPRI.

+
source

pub fn poll_on_write(&mut self, val: bool) -> &mut WaitFd

Indicate that the socket should poll on write events such as the socket +being clear to write without blocking.

+

Corresponds to CURL_WAIT_POLLOUT.

+
source

pub fn received_read(&self) -> bool

After a call to wait, returns true if poll_on_read was set and a +read event occured.

+
source

pub fn received_priority_read(&self) -> bool

After a call to wait, returns true if poll_on_priority_read was set and a +priority read event occured.

+
source

pub fn received_write(&self) -> bool

After a call to wait, returns true if poll_on_write was set and a +write event occured.

+

Trait Implementations§

source§

impl Debug for WaitFd

source§

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

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

impl From<pollfd> for WaitFd

source§

fn from(pfd: pollfd) -> WaitFd

Converts to this type from the input type.

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/multi/type.Socket.html b/curl/multi/type.Socket.html new file mode 100644 index 000000000..dc96cf9e6 --- /dev/null +++ b/curl/multi/type.Socket.html @@ -0,0 +1,3 @@ +Socket in curl::multi - Rust +

Type Alias curl::multi::Socket

source ·
pub type Socket = curl_socket_t;
Expand description

Raw underlying socket type that the multi handles use

+
\ No newline at end of file diff --git a/curl/sidebar-items.js b/curl/sidebar-items.js new file mode 100644 index 000000000..64619977b --- /dev/null +++ b/curl/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["init"],"mod":["easy","multi"],"struct":["Error","FormError","MultiError","Protocols","ShareError","Version"]}; \ No newline at end of file diff --git a/curl/struct.Error.html b/curl/struct.Error.html new file mode 100644 index 000000000..5b149d1b0 --- /dev/null +++ b/curl/struct.Error.html @@ -0,0 +1,78 @@ +Error in curl - Rust +

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.
\ No newline at end of file diff --git a/curl/struct.FormError.html b/curl/struct.FormError.html new file mode 100644 index 000000000..d3d889469 --- /dev/null +++ b/curl/struct.FormError.html @@ -0,0 +1,28 @@ +FormError in curl - Rust +

Struct curl::FormError

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

An error from “form add” operations.

+

THis structure wraps a CURLFORMcode.

+

Implementations§

source§

impl FormError

source

pub fn new(code: CURLFORMcode) -> FormError

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

+
source

pub fn is_memory(&self) -> bool

Returns whether this error corresponds to CURL_FORMADD_MEMORY.

+
source

pub fn is_option_twice(&self) -> bool

Returns whether this error corresponds to CURL_FORMADD_OPTION_TWICE.

+
source

pub fn is_null(&self) -> bool

Returns whether this error corresponds to CURL_FORMADD_NULL.

+
source

pub fn is_unknown_option(&self) -> bool

Returns whether this error corresponds to CURL_FORMADD_UNKNOWN_OPTION.

+
source

pub fn is_incomplete(&self) -> bool

Returns whether this error corresponds to CURL_FORMADD_INCOMPLETE.

+
source

pub fn is_illegal_array(&self) -> bool

Returns whether this error corresponds to CURL_FORMADD_ILLEGAL_ARRAY.

+
source

pub fn is_disabled(&self) -> bool

Returns whether this error corresponds to CURL_FORMADD_DISABLED.

+
source

pub fn code(&self) -> CURLFORMcode

Returns the value of the underlying error corresponding to libcurl.

+
source

pub fn description(&self) -> &str

Returns a human-readable description of this error code.

+

Trait Implementations§

source§

impl Clone for FormError

source§

fn clone(&self) -> FormError

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 FormError

source§

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

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

impl Display for FormError

source§

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

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

impl Error for FormError

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<FormError> for Error

source§

fn from(e: FormError) -> Error

Converts to this type from the input type.
source§

impl PartialEq for FormError

source§

fn eq(&self, other: &FormError) -> 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 FormError

Auto Trait Implementations§

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.
\ No newline at end of file diff --git a/curl/struct.MultiError.html b/curl/struct.MultiError.html new file mode 100644 index 000000000..61271cbb6 --- /dev/null +++ b/curl/struct.MultiError.html @@ -0,0 +1,28 @@ +MultiError in curl - Rust +

Struct curl::MultiError

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

An error from “multi” operations.

+

THis structure wraps a CURLMcode.

+

Implementations§

source§

impl MultiError

source

pub fn new(code: CURLMcode) -> MultiError

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

+
source

pub fn is_bad_handle(&self) -> bool

Returns whether this error corresponds to CURLM_BAD_HANDLE.

+
source

pub fn is_bad_easy_handle(&self) -> bool

Returns whether this error corresponds to CURLM_BAD_EASY_HANDLE.

+
source

pub fn is_out_of_memory(&self) -> bool

Returns whether this error corresponds to CURLM_OUT_OF_MEMORY.

+
source

pub fn is_internal_error(&self) -> bool

Returns whether this error corresponds to CURLM_INTERNAL_ERROR.

+
source

pub fn is_bad_socket(&self) -> bool

Returns whether this error corresponds to CURLM_BAD_SOCKET.

+
source

pub fn is_unknown_option(&self) -> bool

Returns whether this error corresponds to CURLM_UNKNOWN_OPTION.

+
source

pub fn is_call_perform(&self) -> bool

Returns whether this error corresponds to CURLM_CALL_MULTI_PERFORM.

+
source

pub fn code(&self) -> CURLMcode

Returns the value of the underlying error corresponding to libcurl.

+
source

pub fn description(&self) -> &str

Returns curl’s human-readable description of this error.

+

Trait Implementations§

source§

impl Clone for MultiError

source§

fn clone(&self) -> MultiError

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 MultiError

source§

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

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

impl Display for MultiError

source§

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

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

impl Error for MultiError

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<MultiError> for Error

source§

fn from(e: MultiError) -> Error

Converts to this type from the input type.
source§

impl PartialEq for MultiError

source§

fn eq(&self, other: &MultiError) -> 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 MultiError

Auto Trait Implementations§

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.
\ No newline at end of file diff --git a/curl/struct.Protocols.html b/curl/struct.Protocols.html new file mode 100644 index 000000000..f19b6af80 --- /dev/null +++ b/curl/struct.Protocols.html @@ -0,0 +1,193 @@ +Protocols in curl - Rust +

Struct curl::Protocols

source ·
pub struct Protocols<'a> { /* private fields */ }
Expand description

An iterator over the list of protocols a version supports.

+

Trait Implementations§

source§

impl<'a> Clone for Protocols<'a>

source§

fn clone(&self) -> Protocols<'a>

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<'a> Debug for Protocols<'a>

source§

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

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

impl<'a> Iterator for Protocols<'a>

§

type Item = &'a str

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<&'a str>

Advances the iterator and returns the next value. Read more
source§

fn next_chunk<const N: usize>( + &mut self +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
1.0.0 · source§

fn count(self) -> usize
where + Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>
where + Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>
where + Self: Sized,

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
where + Self: Sized, + G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each +element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)
where + Self: Sized, + F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>
where + Self: Sized,

Creates an iterator which gives the current iteration count as well as +the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>
where + Self: Sized,

Creates an iterator which can use the peek and peek_mut methods +to look at the next element of the iterator without consuming it. See +their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
where + Self: Sized, + P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>
where + Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>
where + Self: Sized,

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where + Self: Sized, + F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but +unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where + Self: Sized, + U: IntoIterator, + F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
source§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
where + Self: Sized, + F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over +self and returns an iterator over the outputs of f. Like slice::windows(), +the windows during mapping overlap as well. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>
where + Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where + Self: Sized, + F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> B
where + B: FromIterator<Self::Item>, + Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut E
where + E: Extend<Self::Item>, + Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)
where + Self: Sized, + B: Default + Extend<Self::Item>, + F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> bool
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> R
where + Self: Sized, + F: FnMut(Self::Item) -> R, + R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, +returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more
source§

fn try_reduce<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> R, + R: Try<Output = Self::Item>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the +closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns +the first non-none result. Read more
source§

fn try_find<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
where + Self: Sized, + F: FnMut(&Self::Item) -> R, + R: Try<Output = bool>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns +the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the +specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the +specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
where + FromA: Default + Extend<A>, + FromB: Default + Extend<B>, + Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>
where + T: 'a + Copy, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>
where + T: 'a + Clone, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
1.0.0 · source§

fn cycle(self) -> Cycle<Self>
where + Self: Sized + Clone,

Repeats an iterator endlessly. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> S
where + Self: Sized, + S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> P
where + Self: Sized, + P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Lexicographically compares the PartialOrd elements of +this Iterator with those of another. The comparison works like short-circuit +evaluation, returning a result without comparing the remaining elements. +As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are equal to those of +another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> bool
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are not equal to those of +another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> bool
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> K, + K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Protocols<'a>

§

impl<'a> !Send for Protocols<'a>

§

impl<'a> !Sync for Protocols<'a>

§

impl<'a> Unpin for Protocols<'a>

§

impl<'a> UnwindSafe for Protocols<'a>

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<I> IntoIterator for I
where + I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
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, 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.
\ No newline at end of file diff --git a/curl/struct.ShareError.html b/curl/struct.ShareError.html new file mode 100644 index 000000000..7371be7c8 --- /dev/null +++ b/curl/struct.ShareError.html @@ -0,0 +1,25 @@ +ShareError in curl - Rust +

Struct curl::ShareError

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

An error returned from “share” operations.

+

This structure wraps a CURLSHcode.

+

Implementations§

source§

impl ShareError

source

pub fn new(code: CURLSHcode) -> ShareError

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

+
source

pub fn is_bad_option(&self) -> bool

Returns whether this error corresponds to CURLSHE_BAD_OPTION.

+
source

pub fn is_in_use(&self) -> bool

Returns whether this error corresponds to CURLSHE_IN_USE.

+
source

pub fn is_invalid(&self) -> bool

Returns whether this error corresponds to CURLSHE_INVALID.

+
source

pub fn is_nomem(&self) -> bool

Returns whether this error corresponds to CURLSHE_NOMEM.

+
source

pub fn code(&self) -> CURLSHcode

Returns the value of the underlying error corresponding to libcurl.

+
source

pub fn description(&self) -> &str

Returns curl’s human-readable version of this error.

+

Trait Implementations§

source§

impl Clone for ShareError

source§

fn clone(&self) -> ShareError

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 ShareError

source§

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

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

impl Display for ShareError

source§

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

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

impl Error for ShareError

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<ShareError> for Error

source§

fn from(e: ShareError) -> Error

Converts to this type from the input type.
source§

impl PartialEq for ShareError

source§

fn eq(&self, other: &ShareError) -> 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 ShareError

Auto Trait Implementations§

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.
\ No newline at end of file diff --git a/curl/struct.Version.html b/curl/struct.Version.html new file mode 100644 index 000000000..952c121a8 --- /dev/null +++ b/curl/struct.Version.html @@ -0,0 +1,73 @@ +Version in curl - Rust +

Struct curl::Version

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

Version information about libcurl and the capabilities that it supports.

+

Implementations§

source§

impl Version

source

pub fn num() -> &'static str

Returns the libcurl version that this library is currently linked against.

+
source

pub fn get() -> Version

Returns the libcurl version that this library is currently linked against.

+
source

pub fn version(&self) -> &str

Returns the human readable version string,

+
source

pub fn version_num(&self) -> u32

Returns a numeric representation of the version number

+

This is a 24 bit number made up of the major number, minor, and then +patch number. For example 7.9.8 will return 0x070908.

+
source

pub fn vendored(&self) -> bool

Returns true if this was built with the vendored version of libcurl.

+
source

pub fn host(&self) -> &str

Returns a human readable string of the host libcurl is built for.

+

This is discovered as part of the build environment.

+
source

pub fn feature_ipv6(&self) -> bool

Returns whether libcurl supports IPv6

+
source

pub fn feature_ssl(&self) -> bool

Returns whether libcurl supports SSL

+
source

pub fn feature_libz(&self) -> bool

Returns whether libcurl supports HTTP deflate via libz

+
source

pub fn feature_ntlm(&self) -> bool

Returns whether libcurl supports HTTP NTLM

+
source

pub fn feature_gss_negotiate(&self) -> bool

Returns whether libcurl supports HTTP GSSNEGOTIATE

+
source

pub fn feature_debug(&self) -> bool

Returns whether libcurl was built with debug capabilities

+
source

pub fn feature_spnego(&self) -> bool

Returns whether libcurl was built with SPNEGO authentication

+
source

pub fn feature_largefile(&self) -> bool

Returns whether libcurl was built with large file support

+
source

pub fn feature_idn(&self) -> bool

Returns whether libcurl was built with support for IDNA, domain names +with international letters.

+
source

pub fn feature_sspi(&self) -> bool

Returns whether libcurl was built with support for SSPI.

+
source

pub fn feature_async_dns(&self) -> bool

Returns whether libcurl was built with asynchronous name lookups.

+
source

pub fn feature_conv(&self) -> bool

Returns whether libcurl was built with support for character +conversions.

+
source

pub fn feature_tlsauth_srp(&self) -> bool

Returns whether libcurl was built with support for TLS-SRP.

+
source

pub fn feature_ntlm_wb(&self) -> bool

Returns whether libcurl was built with support for NTLM delegation to +winbind helper.

+
source

pub fn feature_unix_domain_socket(&self) -> bool

Returns whether libcurl was built with support for unix domain socket

+
source

pub fn feature_https_proxy(&self) -> bool

Returns whether libcurl was built with support for HTTPS proxy.

+
source

pub fn feature_http2(&self) -> bool

Returns whether libcurl was built with support for HTTP2.

+
source

pub fn feature_http3(&self) -> bool

Returns whether libcurl was built with support for HTTP3.

+
source

pub fn feature_brotli(&self) -> bool

Returns whether libcurl was built with support for Brotli.

+
source

pub fn feature_altsvc(&self) -> bool

Returns whether libcurl was built with support for Alt-Svc.

+
source

pub fn feature_zstd(&self) -> bool

Returns whether libcurl was built with support for zstd

+
source

pub fn feature_unicode(&self) -> bool

Returns whether libcurl was built with support for unicode

+
source

pub fn feature_hsts(&self) -> bool

Returns whether libcurl was built with support for hsts

+
source

pub fn feature_gsasl(&self) -> bool

Returns whether libcurl was built with support for gsasl

+
source

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

Returns the version of OpenSSL that is used, or None if there is no SSL +support.

+
source

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

Returns the version of libz that is used, or None if there is no libz +support.

+
source

pub fn protocols(&self) -> Protocols<'_>

Returns an iterator over the list of protocols that this build of +libcurl supports.

+
source

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

If available, the human readable version of ares that libcurl is linked +against.

+
source

pub fn ares_version_num(&self) -> Option<u32>

If available, the version of ares that libcurl is linked against.

+
source

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

If available, the version of libidn that libcurl is linked against.

+
source

pub fn iconv_version_num(&self) -> Option<u32>

If available, the version of iconv libcurl is linked against.

+
source

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

If available, the version of libssh that libcurl is linked against.

+
source

pub fn brotli_version_num(&self) -> Option<u32>

If available, the version of brotli libcurl is linked against.

+
source

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

If available, the version of brotli libcurl is linked against.

+
source

pub fn nghttp2_version_num(&self) -> Option<u32>

If available, the version of nghttp2 libcurl is linked against.

+
source

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

If available, the version of nghttp2 libcurl is linked against.

+
source

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

If available, the version of quic libcurl is linked against.

+
source

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

If available, the built-in default of CURLOPT_CAINFO.

+
source

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

If available, the built-in default of CURLOPT_CAPATH.

+
source

pub fn zstd_ver_num(&self) -> Option<u32>

If avaiable, the numeric zstd version

+

Represented as (MAJOR << 24) | (MINOR << 12) | PATCH

+
source

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

If available, the human readable version of zstd

+
source

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

If available, the human readable version of hyper

+
source

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

If available, the human readable version of hyper

+

Trait Implementations§

source§

impl Debug for Version

source§

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

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

impl Send for Version

source§

impl Sync for Version

Auto Trait Implementations§

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, 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.
\ No newline at end of file diff --git a/curl/version/struct.Protocols.html b/curl/version/struct.Protocols.html new file mode 100644 index 000000000..6e983687c --- /dev/null +++ b/curl/version/struct.Protocols.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../curl/struct.Protocols.html...

+ + + \ No newline at end of file diff --git a/curl/version/struct.Version.html b/curl/version/struct.Version.html new file mode 100644 index 000000000..09207a2b9 --- /dev/null +++ b/curl/version/struct.Version.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../curl/struct.Version.html...

+ + + \ No newline at end of file diff --git a/help.html b/help.html new file mode 100644 index 000000000..b9a665a13 --- /dev/null +++ b/help.html @@ -0,0 +1,2 @@ +Help +

Rustdoc help

Back
\ No newline at end of file diff --git a/search-index.js b/search-index.js new file mode 100644 index 000000000..71c0f3119 --- /dev/null +++ b/search-index.js @@ -0,0 +1,5 @@ +var searchIndex = new Map(JSON.parse('[\ +["curl",{"doc":"Rust bindings to the libcurl C library","t":"FFFFFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNHNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPPPFPPPPFFPFKPPPPGPPPGGFPFGPPPFPPFGGPGPPPPPPFGPPPGPPPPPFPPPPPPPPGNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFFFFFIFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN","n":["Error","FormError","MultiError","Protocols","ShareError","Version","ares_version","ares_version_num","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","brotli_version","brotli_version_num","cainfo","capath","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","code","code","code","code","description","description","description","description","easy","eq","eq","eq","eq","extra_description","feature_altsvc","feature_async_dns","feature_brotli","feature_conv","feature_debug","feature_gsasl","feature_gss_negotiate","feature_hsts","feature_http2","feature_http3","feature_https_proxy","feature_idn","feature_ipv6","feature_largefile","feature_libz","feature_ntlm","feature_ntlm_wb","feature_spnego","feature_ssl","feature_sspi","feature_tlsauth_srp","feature_unicode","feature_unix_domain_socket","feature_zstd","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","get","gsasl_version","host","hyper_version","iconv_version_num","init","into","into","into","into","into","into","into_iter","is_aborted_by_callback","is_again","is_bad_content_encoding","is_bad_download_resume","is_bad_easy_handle","is_bad_function_argument","is_bad_handle","is_bad_option","is_bad_socket","is_call_perform","is_chunk_failed","is_conv_failed","is_conv_required","is_couldnt_connect","is_couldnt_resolve_host","is_couldnt_resolve_proxy","is_disabled","is_failed_init","is_file_couldnt_read_file","is_filesize_exceeded","is_function_not_found","is_got_nothing","is_http2_error","is_http2_stream_error","is_http_post_error","is_http_returned_error","is_illegal_array","is_in_use","is_incomplete","is_interface_failed","is_internal_error","is_invalid","is_login_denied","is_memory","is_nomem","is_null","is_operation_timedout","is_option_twice","is_out_of_memory","is_out_of_memory","is_partial_file","is_peer_failed_verification","is_quote_error","is_range_error","is_read_error","is_recv_error","is_remote_access_denied","is_send_error","is_send_fail_rewind","is_ssl_cacert","is_ssl_cacert_badfile","is_ssl_certproblem","is_ssl_cipher","is_ssl_connect_error","is_ssl_crl_badfile","is_ssl_engine_initfailed","is_ssl_engine_notfound","is_ssl_engine_setfailed","is_ssl_issuer_error","is_ssl_shutdown_failed","is_too_many_redirects","is_unknown_option","is_unknown_option","is_unknown_option","is_unsupported_protocol","is_upload_failed","is_url_malformed","is_use_ssl_failed","is_write_error","libidn_version","libssh_version","libz_version","multi","new","new","new","new","next","nghttp2_version","nghttp2_version_num","num","protocols","quic_version","set_extra","ssl_version","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","vendored","version","version_num","zstd_ver_num","zstd_version","Abort","Any","Any","Auth","CantSeek","DataIn","DataOut","Default","Easy","Easy2","Fail","Form","Handler","HeaderIn","HeaderOut","Http","Http1","HttpVersion","IfModifiedSince","IfUnmodifiedSince","Ignored","InfoType","IpResolve","Iter","LastModified","List","NetRc","None","Ok","Optional","Part","Pause","Pause","PostRedirections","ProxyType","ReadError","Required","SeekResult","Socks4","Socks4a","Socks5","Socks5Hostname","SslDataIn","SslDataOut","SslOpt","SslVersion","Sslv2","Sslv3","Text","TimeCondition","Tlsv1","Tlsv10","Tlsv11","Tlsv12","Tlsv13","Transfer","V10","V11","V2","V2PriorKnowledge","V2TLS","V3","V4","V6","WriteError","abstract_unix_socket","abstract_unix_socket","accept_encoding","accept_encoding","add","address_scope","address_scope","allow_beast","appconnect_time","appconnect_time","append","auto","auto_client_cert","autoreferer","autoreferer","aws_sigv4","aws_sigv4","aws_sigv4","basic","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","buffer","buffer_size","buffer_size","cainfo","cainfo","capath","capath","certinfo","certinfo","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","connect_only","connect_only","connect_time","connect_time","connect_timeout","connect_timeout","connect_to","connect_to","content_header","content_length_download","content_length_download","content_type","content_type","content_type","content_type_bytes","content_type_bytes","contents","cookie","cookie","cookie_file","cookie_file","cookie_jar","cookie_jar","cookie_list","cookie_list","cookie_session","cookie_session","cookies","cookies","crlfile","crlfile","custom_request","custom_request","debug","debug","debug_function","debug_function","digest","digest_ie","dns_cache_timeout","dns_cache_timeout","dns_servers","dns_servers","doh_ssl_verify_host","doh_ssl_verify_host","doh_ssl_verify_peer","doh_ssl_verify_peer","doh_ssl_verify_status","doh_ssl_verify_status","doh_url","doh_url","download_size","download_size","drop","drop","drop","drop","effective_url","effective_url","effective_url_bytes","effective_url_bytes","egd_socket","egd_socket","expect_100_timeout","fail_on_error","fail_on_error","fetch_filetime","fetch_filetime","file","file_content","filename","filetime","filetime","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","follow_location","follow_location","forbid_reuse","forbid_reuse","fresh_connect","fresh_connect","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","get","get","get_mut","get_ref","gssnegotiate","header","header","header_function","header_function","header_size","header_size","http_09_allowed","http_09_allowed","http_auth","http_auth","http_connectcode","http_connectcode","http_content_decoding","http_content_decoding","http_headers","http_headers","http_proxy_tunnel","http_proxy_tunnel","http_transfer_decoding","http_transfer_decoding","http_version","http_version","httppost","httppost","ignore_content_length","ignore_content_length","in_filesize","in_filesize","interface","interface","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_iter","into_iter","ip_resolve","ip_resolve","issuer_cert","issuer_cert","issuer_cert_blob","issuer_cert_blob","iter","key_password","key_password","local_ip","local_ip","local_port","local_port","local_port_range","local_port_range","low_speed_limit","low_speed_limit","low_speed_time","low_speed_time","max_connects","max_connects","max_filesize","max_filesize","max_recv_speed","max_recv_speed","max_redirections","max_redirections","max_send_speed","max_send_speed","maxage_conn","maxage_conn","namelookup_time","namelookup_time","native_ca","netrc","netrc","new","new","new","new","new","new","new","next","no_partial_chain","no_revoke","nobody","nobody","noproxy","noproxy","ntlm","ntlm_wb","open_socket","open_socket","os_errno","os_errno","part","password","password","path_as_is","path_as_is","perform","perform","perform","pinned_public_key","pinned_public_key","pipewait","pipewait","port","port","post","post","post_field_size","post_field_size","post_fields_copy","post_fields_copy","post_redirections","post_redirections","pretransfer_time","pretransfer_time","primary_ip","primary_ip","primary_port","primary_port","progress","progress","progress","progress","progress_function","progress_function","proxy","proxy","proxy_auth","proxy_auth","proxy_cainfo","proxy_cainfo","proxy_capath","proxy_capath","proxy_crlfile","proxy_crlfile","proxy_issuer_cert","proxy_issuer_cert","proxy_issuer_cert_blob","proxy_issuer_cert_blob","proxy_key_password","proxy_key_password","proxy_password","proxy_password","proxy_port","proxy_port","proxy_ssl_cainfo_blob","proxy_ssl_cainfo_blob","proxy_ssl_cipher_list","proxy_ssl_cipher_list","proxy_ssl_min_max_version","proxy_ssl_min_max_version","proxy_ssl_options","proxy_ssl_options","proxy_ssl_verify_host","proxy_ssl_verify_host","proxy_ssl_verify_peer","proxy_ssl_verify_peer","proxy_ssl_version","proxy_ssl_version","proxy_sslcert","proxy_sslcert","proxy_sslcert_blob","proxy_sslcert_blob","proxy_sslcert_type","proxy_sslcert_type","proxy_sslkey","proxy_sslkey","proxy_sslkey_blob","proxy_sslkey_blob","proxy_sslkey_type","proxy_sslkey_type","proxy_type","proxy_type","proxy_username","proxy_username","put","put","random_file","random_file","range","range","raw","raw","read","read","read_function","read_function","recv","recv","redirect_301","redirect_302","redirect_303","redirect_all","redirect_count","redirect_count","redirect_time","redirect_time","redirect_url","redirect_url","redirect_url_bytes","redirect_url_bytes","referer","referer","request_size","request_size","reset","reset","resolve","resolve","response_code","response_code","resume_from","resume_from","revoke_best_effort","seek","seek","seek_function","seek_function","send","send","set_local_port","set_local_port","show_header","show_header","signal","signal","ssl_cainfo_blob","ssl_cainfo_blob","ssl_cert","ssl_cert","ssl_cert_blob","ssl_cert_blob","ssl_cert_type","ssl_cert_type","ssl_cipher_list","ssl_cipher_list","ssl_ctx","ssl_ctx","ssl_ctx_function","ssl_ctx_function","ssl_engine","ssl_engine","ssl_engine_default","ssl_engine_default","ssl_key","ssl_key","ssl_key_blob","ssl_key_blob","ssl_key_type","ssl_key_type","ssl_min_max_version","ssl_min_max_version","ssl_options","ssl_options","ssl_sessionid_cache","ssl_sessionid_cache","ssl_verify_host","ssl_verify_host","ssl_verify_peer","ssl_verify_peer","ssl_version","ssl_version","starttransfer_time","starttransfer_time","take_error_buf","take_error_buf","tcp_keepalive","tcp_keepalive","tcp_keepidle","tcp_keepidle","tcp_keepintvl","tcp_keepintvl","tcp_nodelay","tcp_nodelay","time_condition","time_condition","time_condition_unmet","time_condition_unmet","time_value","time_value","timeout","timeout","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","total_time","total_time","transfer","transfer_encoding","transfer_encoding","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unix_socket","unix_socket","unix_socket_path","unix_socket_path","unpause_read","unpause_read","unpause_read","unpause_write","unpause_write","unpause_write","unrestricted_auth","unrestricted_auth","upkeep","upkeep","upkeep","upload","upload","upload_buffer_size","upload_buffer_size","upload_size","upload_size","url","url","url_decode","url_decode","url_encode","url_encode","useragent","useragent","username","username","verbose","verbose","wildcard_match","wildcard_match","write","write","write_function","write_function","Easy2Handle","EasyHandle","Events","Message","Multi","MultiWaker","Socket","SocketEvents","WaitFd","action","add","add2","appconnect_time","appconnect_time","assign","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","connect_time","connect_time","content_length_download","content_length_download","content_type","content_type","content_type_bytes","content_type_bytes","cookies","cookies","download_size","download_size","effective_url","effective_url","effective_url_bytes","effective_url_bytes","error","fdset2","filetime","filetime","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","get_mut","get_ref","get_timeout","header_size","header_size","http_connectcode","http_connectcode","input","input","input_and_output","into","into","into","into","into","into","into","into","is_for","is_for2","local_ip","local_ip","local_port","local_port","messages","namelookup_time","namelookup_time","new","new","new","os_errno","os_errno","output","output","perform","pipelining","poll","poll_on_priority_read","poll_on_read","poll_on_write","pretransfer_time","pretransfer_time","primary_ip","primary_ip","primary_port","primary_port","raw","raw","raw","received_priority_read","received_read","received_write","redirect_count","redirect_count","redirect_time","redirect_time","redirect_url","redirect_url","redirect_url_bytes","redirect_url_bytes","remove","remove","remove2","request_size","request_size","response_code","response_code","result","result_for","result_for2","set_fd","set_max_concurrent_streams","set_max_connects","set_max_host_connections","set_max_total_connections","set_pipeline_length","set_token","set_token","socket_function","starttransfer_time","starttransfer_time","time_condition_unmet","time_condition_unmet","timeout","timer_function","to_owned","token","total_time","total_time","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unpause_read","unpause_read","unpause_write","unpause_write","wait","waker","wakeup"],"q":[[0,"curl"],[219,"curl::easy"],[912,"curl::multi"],[1102,"core::option"],[1103,"curl_sys"],[1104,"curl_sys"],[1105,"core::fmt"],[1106,"alloc::string"],[1107,"core::result"],[1108,"core::any"],[1109,"core::time"],[1110,"alloc::vec"],[1111,"std::path"],[1112,"core::convert"],[1113,"core::marker"],[1114,"core::ops::function"],[1115,"core::marker"],[1116,"curl_sys"],[1117,"core::ffi"],[1118,"libc::unix::linux_like"],[1119,"libc::unix"]],"d":["An error returned from various “easy” operations.","An error from “form add” operations.","An error from “multi” operations.","An iterator over the list of protocols a version supports.","An error returned from “share” operations.","Version information about libcurl and the capabilities …","If available, the human readable version of ares that …","If available, the version of ares that libcurl is linked …","","","","","","","","","","","","","If available, the version of brotli libcurl is linked …","If available, the version of brotli libcurl is linked …","If available, the built-in default of CURLOPT_CAINFO.","If available, the built-in default of CURLOPT_CAPATH.","","","","","","","","","","","Returns the value of the underlying error corresponding to …","Returns the value of the underlying error corresponding to …","Returns the value of the underlying error corresponding to …","Returns the value of the underlying error corresponding to …","Returns the general description of this error code, using …","Returns curl’s human-readable version of this error.","Returns curl’s human-readable description of this error.","Returns a human-readable description of this error code.","Bindings to the “easy” libcurl API.","","","","","Returns the extra description of this error, if any is …","Returns whether libcurl was built with support for Alt-Svc.","Returns whether libcurl was built with asynchronous name …","Returns whether libcurl was built with support for Brotli.","Returns whether libcurl was built with support for …","Returns whether libcurl was built with debug capabilities","Returns whether libcurl was built with support for gsasl","Returns whether libcurl supports HTTP GSSNEGOTIATE","Returns whether libcurl was built with support for hsts","Returns whether libcurl was built with support for HTTP2.","Returns whether libcurl was built with support for HTTP3.","Returns whether libcurl was built with support for HTTPS …","Returns whether libcurl was built with support for IDNA, …","Returns whether libcurl supports IPv6","Returns whether libcurl was built with large file support","Returns whether libcurl supports HTTP deflate via libz","Returns whether libcurl supports HTTP NTLM","Returns whether libcurl was built with support for NTLM …","Returns whether libcurl was built with SPNEGO …","Returns whether libcurl supports SSL","Returns whether libcurl was built with support for SSPI.","Returns whether libcurl was built with support for TLS-SRP.","Returns whether libcurl was built with support for unicode","Returns whether libcurl was built with support for unix …","Returns whether libcurl was built with support for zstd","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the libcurl version that this library is currently …","If available, the human readable version of hyper","Returns a human readable string of the host libcurl is …","If available, the human readable version of hyper","If available, the version of iconv libcurl is linked …","Initializes the underlying libcurl library.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Returns whether this error corresponds to …","Returns whether this error corresponds to CURLE_AGAIN.","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to CURLM_BAD_HANDLE.","Returns whether this error corresponds to …","Returns whether this error corresponds to CURLM_BAD_SOCKET.","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to CURLE_CONV_REQD.","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to CURLE_HTTP2.","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to CURLSHE_IN_USE.","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to CURLSHE_INVALID.","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to CURLSHE_NOMEM.","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to CURLE_READ_ERROR.","Returns whether this error corresponds to CURLE_RECV_ERROR.","Returns whether this error corresponds to …","Returns whether this error corresponds to CURLE_SEND_ERROR.","Returns whether this error corresponds to …","Returns whether this error corresponds to CURLE_SSL_CACERT.","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to CURLE_SSL_CIPHER.","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","Returns whether this error corresponds to …","If available, the version of libidn that libcurl is linked …","If available, the version of libssh that libcurl is linked …","Returns the version of libz that is used, or None if there …","Multi - initiating multiple requests simultaneously","Creates a new error from the underlying code returned by …","Creates a new error from the underlying code returned by …","Creates a new error from the underlying code returned by …","Creates a new error from the underlying code returned by …","","If available, the version of nghttp2 libcurl is linked …","If available, the version of nghttp2 libcurl is linked …","Returns the libcurl version that this library is currently …","Returns an iterator over the list of protocols that this …","If available, the version of quic libcurl is linked …","Stores some extra information about this error inside this …","Returns the version of OpenSSL that is used, or None if …","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns true if this was built with the vendored version …","Returns the human readable version string,","Returns a numeric representation of the version number","If avaiable, the numeric zstd version","If available, the human readable version of zstd","Indicates that the connection should be aborted immediately","","We don’t care what http version to use, and we’d like …","Structure which stores possible authentication methods to …","Indicates that although the seek failed libcurl should …","The data is protocol data received from the peer.","The data is protocol data sent to the peer.","","Raw bindings to a libcurl “easy session”.","Raw bindings to a libcurl “easy session”.","Indicates that the seek operation failed, and the entire …","Multipart/formdata for an HTTP POST request.","A trait for the various callbacks used by libcurl to …","The data is header (or header-like) data received from the …","The data is header (or header-like) data sent to the peer.","","","Possible values to pass to the http_version method.","","","Ignoring .netrc file and use information from url","Possible data chunks that can be witnessed as part of the …","Possible values to pass to the ip_resolve method.","An iterator over List","","A linked list of a strings","Options for .netrc parsing.","","Indicates that the seek operation was a success","The use of your ~/.netrc file is optional, and …","One part in a multipart upload, added to a Form.","Indicates that reading should be paused until unpause is …","Indicates that reading should be paused until unpause is …","Structure which stores possible post redirection options …","Possible proxy types that libcurl currently understands.","Possible error codes that can be returned from the …","This value tells the library that use of the file is …","Possible return values from the seek_function callback.","","","","","The data is SSL/TLS (binary) data received from the peer.","The data is SSL/TLS (binary) data sent to the peer.","Structure which stores possible ssl options to pass to …","Possible values to pass to the ssl_version and …","","","The data is informational text.","Possible conditions for the time_condition method.","","","","","","A scoped transfer of information which borrows an Easy and …","Please use HTTP 1.0 in the request","Please use HTTP 1.1 in the request","Please use HTTP 2 in the request (Added in CURL 7.33.0)","Please use HTTP 2 without HTTP/1.1 Upgrade (Added in CURL …","Use version 2 for HTTPS, version 1.1 for HTTP (Added in …","Setting this value will make libcurl attempt to use HTTP/3 …","","","Possible error codes that can be returned from the …","Provides the ABSTRACT UNIX SOCKET which this handle will …","Same as Easy2::abstract_unix_socket","Enables automatic decompression of HTTP downloads.","Same as Easy2::accept_encoding","Attempts to add this part to the Form that it was created …","Configures the scope for local IPv6 addresses.","Same as Easy2::address_scope","Tells libcurl to not attempt to use any workarounds for a …","Get the time until the SSL/SSH handshake is completed","Same as Easy2::appconnect_time","Appends some data into this list.","HTTP Auto authentication.","Tell libcurl to automatically locate and use a client …","Indicates whether the referer header is automatically …","Same as Easy2::autoreferer","Provides AWS V4 signature authentication on HTTP(S) header.","Same as Easy2::aws_sigv4","HTTP AWS V4 signature authentication.","HTTP Basic authentication.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","This is used to provide a custom file upload part without …","Specify the preferred receive buffer size, in bytes.","Same as Easy2::buffer_size","Specify the path to Certificate Authority (CA) bundle","Same as Easy2::cainfo","Specify directory holding CA certificates","Same as Easy2::capath","Request SSL certificate information","Same as Easy2::certinfo","","","","","","","","","","","","","","","","","","","","","","","Configure whether to stop when connected to target server","Same as Easy2::connect_only","Get the time until connect","Same as Easy2::connect_time","Timeout for the connect phase","Same as Easy2::connect_timeout","Connect to a specific host and port.","Same as Easy2::connect_to","Specifies extra headers for the form POST section.","Get the content-length of the download","Same as Easy2::content_length_download","Used in combination with Part::file, provides the …","Get Content-Type","Same as Easy2::content_type","Get Content-Type, in bytes","Same as Easy2::content_type_bytes","A pointer to the contents of this part, the actual data to …","Set the contents of the HTTP Cookie header.","Same as Easy2::cookie","Set the file name to read cookies from.","Same as Easy2::cookie_file","Set the file name to store cookies to.","Same as Easy2::cookie_jar","Add to or manipulate cookies held in memory.","Same as Easy2::cookie_list","Start a new cookie session","Same as Easy2::cookie_session","Get all known cookies","Same as Easy2::cookies","Specify a Certificate Revocation List file","Same as Easy2::crlfile","Set a custom request string","Same as Easy2::custom_request","Specify a debug callback","Specify a debug callback","Same as Easy::debug_function, just takes a non 'static …","Specify a debug callback","HTTP Digest authentication.","HTTP Digest authentication with an IE flavor.","Sets the timeout of how long name resolves will be kept in …","Same as Easy2::dns_cache_timeout","Sets the DNS servers that wil be used.","Same as Easy2::dns_servers","Tells curl to verify the DoH (DNS-over-HTTPS) server’s …","Same as Easy2::doh_ssl_verify_host","This option tells curl to verify the authenticity of the …","Same as Easy2::doh_ssl_verify_peer","Pass a long as parameter set to 1 to enable or 0 to …","Same as Easy2::doh_ssl_verify_status","Provide the DNS-over-HTTPS URL.","Same as Easy2::doh_url","Get the number of downloaded bytes","Same as Easy2::download_size","","","","","Get the last used URL","Same as Easy2::effective_url","Get the last used URL, in bytes","Same as Easy2::effective_url_bytes","Specify EGD socket path.","Same as Easy2::egd_socket","Set maximum time to wait for Expect 100 request before …","Indicates whether this library will fail on HTTP response …","Same as Easy2::fail_on_error","Get the modification time of the remote resource","Same as Easy2::fetch_filetime","Makes this part a file upload part of the given file.","Causes this file to be read and its contents used as data …","Used in combination with Part::file, provides the filename …","Get the remote time of the retrieved document","Same as Easy2::filetime","","","","","","","","","","","","","","","","","","","","","Follow HTTP 3xx redirects.","Same as Easy2::follow_location","Make connection get closed at once after use.","Same as Easy2::forbid_reuse","Force a new connection to be used.","Same as Easy2::fresh_connect","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Ask for a HTTP GET request.","Same as Easy2::get","Acquires a reference to the underlying handler for events.","Acquires a reference to the underlying handler for events.","HTTP Negotiate (SPNEGO) authentication.","Callback that receives header data","Callback that receives header data","Same as Easy::header_function, just takes a non 'static …","Callback that receives header data","Get size of retrieved headers","Same as Easy2::header_size","Allow HTTP/0.9 compliant responses","Same as Easy2::http_09_allowed","Set HTTP server authentication methods to try","Same as Easy2::http_auth","Get the CONNECT response code","Same as Easy2::http_connectcode","Enable or disable HTTP content decoding.","Same as Easy2::http_content_decoding","Add some headers to this HTTP request.","Same as Easy2::http_headers","Inform curl whether it should tunnel all operations …","Same as Easy2::http_proxy_tunnel","Enable or disable HTTP transfer decoding.","Same as Easy2::http_transfer_decoding","Set preferred HTTP version.","Same as Easy2::http_version","Tells libcurl you want a multipart/formdata HTTP POST to …","Same as Easy2::httppost","Ignore the content-length header.","Same as Easy2::ignore_content_length","Set the size of the input file to send off.","Same as Easy2::in_filesize","Tell curl which interface to bind to for an outgoing …","Same as Easy2::interface","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","Specify which IP protocol version to use","Same as Easy2::ip_resolve","Set the issuer SSL certificate filename","Same as Easy2::issuer_cert","Set the issuer SSL certificate using an in-memory blob.","Same as Easy2::issuer_cert_blob","Returns an iterator over the nodes in this list.","Set passphrase to private key.","Same as Easy2::key_password","Get local IP address of last connection","Same as Easy2::local_ip","Get the latest local port number","Same as Easy2::local_port","Indicates the number of attempts libcurl will perform to …","Same as Easy2::local_port_range","Set the low speed limit in bytes per second.","Same as Easy2::low_speed_limit","Set the low speed time period.","Same as Easy2::low_speed_time","Set the maximum connection cache size.","Same as Easy2::max_connects","Configure the maximum file size to download.","Same as Easy2::max_filesize","Rate limit data download speed","Same as Easy2::max_recv_speed","Set the maximum number of redirects allowed.","Same as Easy2::max_redirections","Rate limit data upload speed","Same as Easy2::max_send_speed","Set the maximum idle time allowed for a connection.","Same as Easy2::maxage_conn","Get the name lookup time","Same as Easy2::namelookup_time","Tell libcurl to use the operating system’s native CA …","Enable .netrc parsing","Same as Easy2::netrc","Creates a new blank form ready for the addition of new …","Creates a new “easy” handle which is the core of …","Create an empty PostRedirection setting with no flags set.","Creates a new empty list of strings.","Creates a new “easy” handle which is the core of …","Creates a new set of authentications with no members.","Creates a new set of SSL options.","","Tells libcurl to not accept “partial” certificate …","Tells libcurl to disable certificate revocation checks for …","Indicate whether to download the request without getting …","Same as Easy2::nobody","Provide a list of hosts that should not be proxied to.","Same as Easy2::noproxy","HTTP NTLM authentication.","NTLM delegating to winbind helper.","Callback to open sockets for libcurl.","Callback to open sockets for libcurl.","Get errno number from last connect failure.","Same as Easy2::os_errno","Prepares adding a new part to this Form","Configures the password to pass as authentication for this …","Same as Easy2::password","Indicates whether sequences of /../ and /./ will be …","Same as Easy2::path_as_is","Same as Easy::perform.","After options have been set, this will perform the …","Same as Easy2::perform","Set pinned public key.","Same as Easy2::pinned_public_key","Wait for pipelining/multiplexing","Same as Easy2::pipewait","Configures the port number to connect to, instead of the …","Same as Easy2::port","Make an HTTP POST request.","Same as Easy2::post","Configures the size of data that’s going to be uploaded …","Same as Easy2::post_field_size","Configures the data that will be uploaded as part of a …","Same as Easy2::post_field_copy","Set the policy for handling redirects to POST requests.","Same as Easy2::post_redirections","Get the time until the file transfer start","Same as Easy2::pretransfer_time","Get IP address of last connection.","Same as Easy2::primary_ip","Get the latest destination port number","Same as Easy2::primary_port","Callback to progress meter function","Callback to progress meter function","Indicates whether a progress meter will be shown for …","Same as Easy2::progress","Same as Easy::progress_function, just takes a non 'static …","Callback to progress meter function","Provide the URL of a proxy to use.","Same as Easy2::proxy","Set HTTP proxy authentication methods to try","Same as Easy2::proxy_auth","Set CA certificate to verify peer against for proxy.","Same as Easy2::proxy_cainfo","Specify a directory holding CA certificates for proxy.","Same as Easy2::proxy_capath","Specify a Certificate Revocation List file to use when …","Same as Easy2::proxy_crlfile","Set the issuer SSL certificate filename for HTTPS proxies","Same as Easy2::proxy_issuer_cert","Set the issuer SSL certificate for HTTPS proxies using an …","Same as Easy2::proxy_issuer_cert_blob","Set passphrase to private key for HTTPS proxy.","Same as Easy2::proxy_key_password","Configures the proxy password to pass as authentication …","Same as Easy2::proxy_password","Provide port number the proxy is listening on.","Same as Easy2::proxy_port","Set the SSL Certificate Authorities for HTTPS proxies …","Same as Easy2::proxy_ssl_cainfo_blob","Specify ciphers to use for TLS for an HTTPS proxy.","Same as Easy2::proxy_ssl_cipher_list","Set preferred TLS/SSL version with minimum version and …","Same as Easy2::proxy_ssl_min_max_version","Set SSL behavior options for proxies","Same as Easy2::proxy_ssl_options","Verify the certificate’s name against host for HTTPS …","Same as Easy2::proxy_ssl_verify_host","Verify the peer’s SSL certificate for HTTPS proxy.","Same as Easy2::proxy_ssl_verify_peer","Set preferred TLS/SSL version when connecting to an HTTPS …","Same as Easy2::proxy_ssl_version","Set client certificate for proxy.","Same as Easy2::proxy_sslcert","Set the client certificate for the proxy using an …","Same as Easy2::proxy_sslcert_blob","Specify type of the client SSL certificate for HTTPS proxy.","Same as Easy2::proxy_sslcert_type","Set private key for HTTPS proxy.","Same as Easy2::proxy_sslkey","Set the private key for the proxy using an in-memory blob.","Same as Easy2::proxy_sslkey_blob","Set type of the private key file for HTTPS proxy.","Same as Easy2::proxy_sslkey_type","Indicates the type of proxy being used.","Same as Easy2::proxy_type","Configures the proxy username to pass as authentication …","Same as Easy2::proxy_username","Make an HTTP PUT request.","Same as Easy2::put","Specify a source for random data","Same as Easy2::random_file","Indicates the range that this request should retrieve.","Same as Easy2::range","Get a pointer to the raw underlying CURL handle.","Same as Easy2::raw","Read callback for data uploads.","Read callback for data uploads.","Same as Easy::read_function, just takes a non 'static …","Read callback for data uploads.","Receives data from a connected socket.","Same as Easy2::recv","Configure POST method behaviour on a 301 redirect. Setting …","Configure POST method behaviour on a 302 redirect. Setting …","Configure POST method behaviour on a 303 redirect. Setting …","Configure POST method behaviour for all redirects. Setting …","Get the number of redirects","Same as Easy2::redirect_count","Get the time for all redirection steps","Same as Easy2::redirect_time","Get the URL a redirect would go to","Same as Easy2::redirect_url","Get the URL a redirect would go to, in bytes","Same as Easy2::redirect_url_bytes","Sets the HTTP referer header","Same as Easy2::referer","Get size of sent request.","Same as Easy2::request_size","Re-initializes this handle to the default values.","Same as Easy2::reset","Specify custom host name to IP address resolves.","Same as Easy2::resolve","Get the last response code","Same as Easy2::response_code","Set a point to resume transfer from","Same as Easy2::resume_from","Tells libcurl to ignore certificate revocation checks in …","User callback for seeking in input stream.","User callback for seeking in input stream.","Same as Easy::seek_function, just takes a non 'static …","User callback for seeking in input stream.","Sends data over the connected socket.","Same as Easy2::send","Indicate which port should be bound to locally for this …","Same as Easy2::set_local_port","Indicates whether header information is streamed to the …","Same as Easy2::show_header","Inform libcurl whether or not it should install signal …","Same as Easy2::signal","Set the SSL Certificate Authorities using an in-memory …","Same as Easy2::ssl_cainfo_blob","Sets the SSL client certificate.","Same as Easy2::ssl_cert","Set the SSL client certificate using an in-memory blob.","Same as Easy2::ssl_cert_blob","Specify type of the client SSL certificate.","Same as Easy2::ssl_cert_type","Specify ciphers to use for TLS.","Same as Easy2::ssl_cipher_list","Callback to SSL context","Callback to SSL context","Same as Easy::ssl_ctx_function, just takes a non 'static …","Callback to SSL context","Set the SSL engine identifier.","Same as Easy2::ssl_engine","Make this handle’s SSL engine the default.","Same as Easy2::ssl_engine_default","Specify private keyfile for TLS and SSL client cert.","Same as Easy2::ssl_key","Specify an SSL private key using an in-memory blob.","Same as Easy2::ssl_key_blob","Set type of the private key file.","Same as Easy2::ssl_key_type","Set preferred TLS/SSL version with minimum version and …","Same as Easy2::ssl_min_max_version","Set SSL behavior options","Same as Easy2::ssl_options","Enable or disable use of the SSL session-ID cache","Same as Easy2::ssl_sessionid_cache","Verify the certificate’s name against host.","Same as Easy2::ssl_verify_host","Verify the peer’s SSL certificate.","Same as Easy2::ssl_verify_peer","Set preferred TLS/SSL version.","Same as Easy2::ssl_version","Get the time until the first byte is received","Same as Easy2::starttransfer_time","Returns the contents of the internal error buffer, if …","Same as Easy2::take_error_buf","Configures whether TCP keepalive probes will be sent.","Same as Easy2::tcp_keepalive","Configures the TCP keepalive idle time wait.","Same as Easy2::tcp_keepidle","Configures the delay between keepalive probes.","Same as Easy2::tcp_keepintvl","Configures whether the TCP_NODELAY option is set, or Nagle…","Same as Easy2::tcp_nodelay","Selects a condition for a time request.","Same as Easy2::time_condition","Get info on unmet time conditional","Same as Easy2::time_condition_unmet","Sets the time value for a conditional request.","Same as Easy2::time_value","Set maximum time the request is allowed to take.","Same as Easy2::timeout","","","","","","","","","","","","Get total time of previous transfer","Same as Easy2::total_time","Creates a new scoped transfer which can be used to set …","Request the HTTP Transfer Encoding.","Same as Easy2::transfer_encoding","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Provides the Unix domain socket which this handle will …","Same as Easy2::unix_socket","Provides the Unix domain socket which this handle will …","Same as Easy2::unix_socket_path","Same as Easy::unpause_read.","Unpause reading on a connection.","Same as Easy2::unpause_read","Same as Easy::unpause_write","Unpause writing on a connection.","Same as Easy2::unpause_write","Send credentials to hosts other than the first as well.","Same as Easy2::unrestricted_auth","Same as Easy::upkeep","Some protocols have “connection upkeep” mechanisms. …","Same as Easy2::upkeep","Enable or disable data upload.","Same as Easy2::upload","Specify the preferred send buffer size, in bytes.","Same as Easy2::upload_buffer_size","Get the number of uploaded bytes","Same as Easy2::upload_size","Provides the URL which this handle will work with.","Same as Easy2::url","URL decodes a string s, returning None if it fails","Same as Easy2::url_decode","URL encodes a string s","Same as Easy2::url_encode","Sets the HTTP user-agent header","Same as Easy2::useragent","Configures the username to pass as authentication for this …","Same as Easy2::username","Configures this handle to have verbose output to help …","Same as Easy2::verbose","Indicates whether multiple files will be transferred based …","Same as Easy2::wildcard_match","Callback invoked whenever curl has downloaded data for the …","Callback invoked whenever curl has downloaded data for the …","Same as Easy::write_function, just takes a non 'static …","Set callback for writing received data.","Wrapper around an easy handle while it’s owned by a …","Wrapper around an easy handle while it’s owned by a …","Notification of the events that have happened on a socket.","Message from the messages function of a multi handle.","A multi handle for initiating multiple connections …","A handle that can be used to wake up a thread that’s …","Raw underlying socket type that the multi handles use","Notification of events that are requested on a socket.","File descriptor to wait on for use with the wait method on …","Inform of reads/writes available data given an action","Add an easy handle to a multi session","Same as add, but works with the Easy2 type.","Same as Easy2::appconnect_time.","Same as Easy2::appconnect_time.","Set data to associate with an internal socket","","","","","","","","","","","","","","","","","","","Same as Easy2::connect_time.","Same as Easy2::connect_time.","Same as Easy2::content_length_download.","Same as Easy2::content_length_download.","Same as Easy2::content_type.","Same as Easy2::content_type.","Same as Easy2::content_type_bytes.","Same as Easy2::content_type_bytes.","Same as Easy2::cookies.","Same as Easy2::cookies.","Same as Easy2::download_size.","Same as Easy2::download_size.","Same as Easy2::effective_url.","Same as Easy2::effective_url.","Same as Easy2::effective_url_bytes.","Same as Easy2::effective_url_bytes.","Set or unset the whether these events indicate that an …","Extracts file descriptor information from a multi handle","Same as Easy2::filetime.","Same as Easy2::filetime.","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Acquires a reference to the underlying handler for events.","Acquires a reference to the underlying handler for events.","Get how long to wait for action before proceeding","Same as Easy2::header_size.","Same as Easy2::header_size.","Same as Easy2::http_connectcode.","Same as Easy2::http_connectcode.","Set or unset the whether these events indicate that input …","Wait for incoming data. For the socket to become readable.","Wait for incoming and outgoing data. For the socket to …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns whether this easy message was for the specified …","Same as is_for, but for Easy2Handle.","Same as Easy2::local_ip.","Same as Easy2::local_ip.","Same as Easy2::local_port.","Same as Easy2::local_port.","Read multi stack informationals","Same as Easy2::namelookup_time.","Same as Easy2::namelookup_time.","Creates a new multi session through which multiple HTTP …","Creates a new blank event bit mask.","Constructs an empty (invalid) WaitFd.","Same as Easy2::os_errno.","Same as Easy2::os_errno.","Set or unset the whether these events indicate that output …","Wait for outgoing data. For the socket to become writable.","Reads/writes available data from each easy handle.","Enable or disable HTTP pipelining and multiplexing.","Block until activity is detected or a timeout passes.","Indicate that the socket should poll on high priority read …","Indicate that the socket should poll on read events such …","Indicate that the socket should poll on write events such …","Same as Easy2::pretransfer_time.","Same as Easy2::pretransfer_time.","Same as Easy2::primary_ip.","Same as Easy2::primary_ip.","Same as Easy2::primary_port.","Same as Easy2::primary_port.","Get a pointer to the raw underlying CURLM handle.","Get a pointer to the raw underlying CURL handle.","Get a pointer to the raw underlying CURL handle.","After a call to wait, returns true if poll_on_priority_read…","After a call to wait, returns true if poll_on_read was set …","After a call to wait, returns true if poll_on_write was …","Same as Easy2::redirect_count.","Same as Easy2::redirect_count.","Same as Easy2::redirect_time.","Same as Easy2::redirect_time.","Same as Easy2::redirect_url.","Same as Easy2::redirect_url.","Same as Easy2::redirect_url_bytes.","Same as Easy2::redirect_url_bytes.","Remove an easy handle from this multi session","The specified socket/file descriptor is no longer used by …","Same as remove, but for Easy2Handle.","Same as Easy2::request_size.","Same as Easy2::request_size.","Same as Easy2::response_code.","Same as Easy2::response_code.","If this message indicates that a transfer has finished, …","Same as result, except only returns Some for the specified …","Same as result, except only returns Some for the specified …","Set the file descriptor to wait for.","Sets the number of max concurrent streams for http2.","Set size of connection cache.","Sets the max number of connections to a single host.","Sets the max simultaneously open connections.","Sets the pipeline length.","Sets an internal private token for this EasyHandle.","Same as EasyHandle::set_token","Set the callback informed about what to wait for","Same as Easy2::starttransfer_time.","Same as Easy2::starttransfer_time.","Same as Easy2::time_condition_unmet.","Same as Easy2::time_condition_unmet.","Inform libcurl that a timeout has expired and sockets …","Set callback to receive timeout values","","Returns the token associated with the easy handle that …","Same as Easy2::total_time.","Same as Easy2::total_time.","","","","","","","","","","","","","","","","","","","","","","","","","Unpause reading on a connection.","Unpause reading on a connection.","Unpause writing on a connection.","Unpause writing on a connection.","Block until activity is detected or a timeout passes.","Returns a new MultiWaker that can be used to wake up a …","Wakes up a thread that is blocked in Multi::poll. This …"],"i":[0,0,0,0,0,0,1,1,1,5,6,7,8,9,1,5,6,7,8,9,1,1,1,1,5,6,7,8,9,5,6,7,8,9,5,6,7,8,5,6,7,8,0,5,6,7,8,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,5,6,6,7,7,8,8,9,1,5,5,6,7,8,9,1,1,1,1,1,0,1,5,6,7,8,9,9,5,5,5,5,7,5,7,6,7,7,5,5,5,5,5,5,8,5,5,5,5,5,5,5,5,5,8,6,8,5,7,6,5,8,6,8,5,8,5,7,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,7,8,5,5,5,5,5,1,1,1,0,5,6,7,8,9,1,1,1,1,1,5,1,5,6,7,8,9,5,6,7,8,1,5,6,7,8,9,1,5,6,7,8,9,1,5,6,7,8,9,1,1,1,1,1,54,38,39,0,41,42,42,40,0,0,41,0,0,42,42,36,36,0,37,37,43,0,0,0,37,0,0,37,41,43,0,54,55,0,0,0,43,0,36,36,36,36,42,42,0,0,40,40,42,0,40,40,40,40,40,0,39,39,39,39,39,39,38,38,0,22,25,22,25,26,22,25,27,22,25,29,30,27,22,25,22,25,30,30,50,26,47,22,53,29,25,36,37,38,39,40,41,42,54,55,43,30,27,44,50,26,47,22,53,29,25,36,37,38,39,40,41,42,54,55,43,30,27,44,26,22,25,22,25,22,25,22,25,36,37,38,39,40,41,42,43,30,27,44,36,37,38,39,40,41,42,43,30,27,44,22,25,22,25,22,25,22,25,26,22,25,26,22,25,22,25,26,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,46,46,47,25,30,30,22,25,22,25,22,25,22,25,22,25,22,25,22,25,50,47,22,29,22,25,22,25,22,25,22,22,25,22,25,26,26,26,22,25,50,26,47,22,53,29,25,36,37,38,39,40,41,42,54,55,43,30,27,44,22,25,22,25,22,25,50,26,47,22,53,29,25,36,37,38,39,40,41,42,54,55,43,30,27,44,22,25,22,22,30,46,46,47,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,50,26,47,22,53,29,25,36,37,38,39,40,41,42,54,55,43,30,27,44,29,44,22,25,22,25,22,25,29,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,27,22,25,50,22,53,29,25,30,27,44,27,27,22,25,22,25,30,30,46,46,22,25,50,22,25,22,25,47,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,46,46,22,25,47,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,46,46,47,25,22,25,53,53,53,53,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,27,46,46,47,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,46,46,47,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,36,37,38,39,40,41,42,43,30,27,44,22,25,25,22,25,50,26,47,22,53,29,25,36,37,38,39,40,41,42,54,55,43,30,27,44,50,26,47,22,53,29,25,36,37,38,39,40,41,42,54,55,43,30,27,44,50,26,47,22,53,29,25,36,37,38,39,40,41,42,54,55,43,30,27,44,22,25,22,25,47,22,25,47,22,25,22,25,47,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,22,25,46,46,47,25,0,0,0,0,0,0,0,0,0,65,65,65,68,69,65,65,72,68,69,67,73,74,70,65,72,68,69,67,73,74,70,70,70,68,69,68,69,68,69,68,69,68,69,68,69,68,69,68,69,67,65,68,69,65,72,68,69,67,73,74,70,65,72,68,69,67,73,74,74,70,69,69,65,68,69,68,69,67,73,73,65,72,68,69,67,73,74,70,72,72,68,69,68,69,65,68,69,65,67,74,68,69,67,73,65,65,65,74,74,74,68,69,68,69,68,69,65,68,69,74,74,74,68,69,68,69,68,69,68,69,65,73,65,68,69,68,69,72,72,72,74,65,65,65,65,65,68,69,65,68,69,68,69,65,65,70,72,68,69,65,72,68,69,67,73,74,70,65,72,68,69,67,73,74,70,65,72,68,69,67,73,74,70,68,69,68,69,65,65,70],"f":[0,0,0,0,0,0,[1,[[3,[2]]]],[1,[[3,[4]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[1,[[3,[2]]]],[1,[[3,[4]]]],[1,[[3,[2]]]],[1,[[3,[2]]]],[5,5],[6,6],[7,7],[8,8],[9,9],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[5,11],[6,12],[7,13],[8,14],[5,2],[6,2],[7,2],[8,2],0,[[5,5],15],[[6,6],15],[[7,7],15],[[8,8],15],[5,[[3,[2]]]],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[1,15],[[1,16],17],[[5,16],17],[[5,16],17],[[6,16],17],[[6,16],17],[[7,16],17],[[7,16],17],[[8,16],17],[[8,16],17],[[9,16],17],[-1,-1,[]],[18,5],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[],1],[1,[[3,[2]]]],[1,2],[1,[[3,[2]]]],[1,[[3,[4]]]],[[],10],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,15],[5,15],[5,15],[5,15],[7,15],[5,15],[7,15],[6,15],[7,15],[7,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[8,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[8,15],[6,15],[8,15],[5,15],[7,15],[6,15],[5,15],[8,15],[6,15],[8,15],[5,15],[8,15],[5,15],[7,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[5,15],[7,15],[8,15],[5,15],[5,15],[5,15],[5,15],[5,15],[1,[[3,[2]]]],[1,[[3,[2]]]],[1,[[3,[2]]]],0,[11,5],[12,6],[13,7],[14,8],[9,[[3,[2]]]],[1,[[3,[2]]]],[1,[[3,[4]]]],[[],2],[1,9],[1,[[3,[2]]]],[[5,19],10],[1,[[3,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,19,[]],[-1,19,[]],[-1,19,[]],[-1,19,[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[1,15],[1,2],[1,4],[1,[[3,[4]]]],[1,[[3,[2]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[[22,[-1]],[24,[23]]],[[20,[10,5]]],[]],[[25,[24,[23]]],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[26,[[20,[10,8]]]],[[[22,[-1]],4],[[20,[10,5]]],[]],[[25,4],[[20,[10,5]]]],[[27,15],27],[[[22,[-1]]],[[20,[28,5]]],[]],[25,[[20,[28,5]]]],[[29,2],[[20,[10,5]]]],[[30,15],30],[[27,15],27],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[30,15],30],[[30,15],30],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[26,-1,[31,[23]]],26,[[33,[32]],34]],[[[22,[-1]],35],[[20,[10,5]]],[]],[[25,35],[[20,[10,5]]]],[[[22,[-1]],-2],[[20,[10,5]]],[],[[33,[32]]]],[[25,-1],[[20,[10,5]]],[[33,[32]]]],[[[22,[-1]],-2],[[20,[10,5]]],[],[[33,[32]]]],[[25,-1],[[20,[10,5]]],[[33,[32]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[36,36],[37,37],[38,38],[39,39],[40,40],[41,41],[42,42],[43,43],[30,30],[27,27],[44,44],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]]],[[20,[28,5]]],[]],[25,[[20,[28,5]]]],[[[22,[-1]],28],[[20,[10,5]]],[]],[[25,28],[[20,[10,5]]]],[[[22,[-1]],29],[[20,[10,5]]],[]],[[25,29],[[20,[10,5]]]],[[26,29],26],[[[22,[-1]]],[[20,[45,5]]],[]],[25,[[20,[45,5]]]],[[26,2],26],[[[22,[-1]]],[[20,[[3,[2]],5]]],[]],[25,[[20,[[3,[2]],5]]]],[[[22,[-1]]],[[20,[[3,[[24,[23]]]],5]]],[]],[25,[[20,[[3,[[24,[23]]]],5]]]],[[26,[24,[23]]],26],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],-2],[[20,[10,5]]],[],[[33,[32]]]],[[25,-1],[[20,[10,5]]],[[33,[32]]]],[[[22,[-1]],-2],[[20,[10,5]]],[],[[33,[32]]]],[[25,-1],[[20,[10,5]]],[[33,[32]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]]],[[20,[29,5]]],[]],[25,[[20,[29,5]]]],[[[22,[-1]],-2],[[20,[10,5]]],[],[[33,[32]]]],[[25,-1],[[20,[10,5]]],[[33,[32]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[46,42,[24,[23]]],10],[[46,42,[24,[23]]],10],[[47,-1],[[20,[10,5]]],[[48,[42,[24,[23]]]]]],[[25,-1],[[20,[10,5]]],[[48,[42,[24,[23]]]],49]],[[30,15],30],[[30,15],30],[[[22,[-1]],28],[[20,[10,5]]],[]],[[25,28],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],[3,[2]]],[[20,[10,5]]],[]],[[25,[3,[2]]],[[20,[10,5]]]],[[[22,[-1]]],[[20,[45,5]]],[]],[25,[[20,[45,5]]]],[50,10],[47,10],[[[22,[-1]]],10,[]],[29,10],[[[22,[-1]]],[[20,[[3,[2]],5]]],[]],[25,[[20,[[3,[2]],5]]]],[[[22,[-1]]],[[20,[[3,[[24,[23]]]],5]]],[]],[25,[[20,[[3,[[24,[23]]]],5]]]],[[[22,[-1]],-2],[[20,[10,5]]],[],[[33,[32]]]],[[25,-1],[[20,[10,5]]],[[33,[32]]]],[[[22,[-1]],28],[[20,[10,5]]],[]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[26,-1],26,[[33,[32]],34]],[[26,-1],26,[[33,[32]]]],[[26,-1],26,[[33,[32]],34]],[[[22,[-1]]],[[20,[[3,[51]],5]]],[]],[25,[[20,[[3,[51]],5]]]],[[50,16],17],[[26,16],17],[[47,16],17],[[[22,[-1]],16],17,52],[[53,16],17],[[29,16],17],[[25,16],17],[[36,16],17],[[37,16],17],[[38,16],17],[[39,16],17],[[40,16],17],[[41,16],17],[[42,16],17],[[54,16],17],[[55,16],17],[[43,16],17],[[30,16],17],[[27,16],17],[[44,16],17],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]]],-1,[]],[[[22,[-1]]],-1,[]],[[30,15],30],[[46,[24,[23]]],15],[[46,[24,[23]]],15],[[47,-1],[[20,[10,5]]],[[48,[[24,[23]]],[[56,[15]]]]]],[[25,-1],[[20,[10,5]]],[[48,[[24,[23]]],[[56,[15]]]],49]],[[[22,[-1]]],[[20,[57,5]]],[]],[25,[[20,[57,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],30],[[20,[10,5]]],[]],[[25,30],[[20,[10,5]]]],[[[22,[-1]]],[[20,[4,5]]],[]],[25,[[20,[4,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],29],[[20,[10,5]]],[]],[[25,29],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],39],[[20,[10,5]]],[]],[[25,39],[[20,[10,5]]]],[[[22,[-1]],50],[[20,[10,5]]],[]],[[25,50],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],57],[[20,[10,5]]],[]],[[25,57],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[29,44],[-1,-2,[],[]],[[[22,[-1]],38],[[20,[10,5]]],[]],[[25,38],[[20,[10,5]]]],[[[22,[-1]],-2],[[20,[10,5]]],[],[[33,[32]]]],[[25,-1],[[20,[10,5]]],[[33,[32]]]],[[[22,[-1]],[24,[23]]],[[20,[10,5]]],[]],[[25,[24,[23]]],[[20,[10,5]]]],[29,44],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]]],[[20,[[3,[2]],5]]],[]],[25,[[20,[[3,[2]],5]]]],[[[22,[-1]]],[[20,[58,5]]],[]],[25,[[20,[58,5]]]],[[[22,[-1]],58],[[20,[10,5]]],[]],[[25,58],[[20,[10,5]]]],[[[22,[-1]],4],[[20,[10,5]]],[]],[[25,4],[[20,[10,5]]]],[[[22,[-1]],28],[[20,[10,5]]],[]],[[25,28],[[20,[10,5]]]],[[[22,[-1]],4],[[20,[10,5]]],[]],[[25,4],[[20,[10,5]]]],[[[22,[-1]],57],[[20,[10,5]]],[]],[[25,57],[[20,[10,5]]]],[[[22,[-1]],57],[[20,[10,5]]],[]],[[25,57],[[20,[10,5]]]],[[[22,[-1]],4],[[20,[10,5]]],[]],[[25,4],[[20,[10,5]]]],[[[22,[-1]],57],[[20,[10,5]]],[]],[[25,57],[[20,[10,5]]]],[[[22,[-1]],28],[[20,[10,5]]],[]],[[25,28],[[20,[10,5]]]],[[[22,[-1]]],[[20,[28,5]]],[]],[25,[[20,[28,5]]]],[[27,15],27],[[[22,[-1]],43],[[20,[10,5]]],[]],[[25,43],[[20,[10,5]]]],[[],50],[-1,[[22,[-1]]],46],[[],53],[[],29],[[],25],[[],30],[[],27],[44,[[3,[[24,[23]]]]]],[[27,15],27],[[27,15],27],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[30,15],30],[[30,15],30],[[46,59,59,59],[[3,[60]]]],[[46,59,59,59],[[3,[60]]]],[[[22,[-1]]],[[20,[61,5]]],[]],[25,[[20,[61,5]]]],[[50,2],26],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[47,[[20,[10,5]]]],[[[22,[-1]]],[[20,[10,5]]],[]],[25,[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],58],[[20,[10,5]]],[]],[[25,58],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],57],[[20,[10,5]]],[]],[[25,57],[[20,[10,5]]]],[[[22,[-1]],[24,[23]]],[[20,[10,5]]],[]],[[25,[24,[23]]],[[20,[10,5]]]],[[[22,[-1]],53],[[20,[10,5]]],[]],[[25,53],[[20,[10,5]]]],[[[22,[-1]]],[[20,[28,5]]],[]],[25,[[20,[28,5]]]],[[[22,[-1]]],[[20,[[3,[2]],5]]],[]],[25,[[20,[[3,[2]],5]]]],[[[22,[-1]]],[[20,[58,5]]],[]],[25,[[20,[58,5]]]],[[46,45,45,45,45],15],[[46,45,45,45,45],15],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[47,-1],[[20,[10,5]]],[[48,[45,45,45,45],[[56,[15]]]]]],[[25,-1],[[20,[10,5]]],[[48,[45,45,45,45],[[56,[15]]]],49]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],30],[[20,[10,5]]],[]],[[25,30],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],-2],[[20,[10,5]]],[],[[33,[32]]]],[[25,-1],[[20,[10,5]]],[[33,[32]]]],[[[22,[-1]],-2],[[20,[10,5]]],[],[[33,[32]]]],[[25,-1],[[20,[10,5]]],[[33,[32]]]],[[[22,[-1]],-2],[[20,[10,5]]],[],[[33,[32]]]],[[25,-1],[[20,[10,5]]],[[33,[32]]]],[[[22,[-1]],[24,[23]]],[[20,[10,5]]],[]],[[25,[24,[23]]],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],58],[[20,[10,5]]],[]],[[25,58],[[20,[10,5]]]],[[[22,[-1]],[24,[23]]],[[20,[10,5]]],[]],[[25,[24,[23]]],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],40,40],[[20,[10,5]]],[]],[[25,40,40],[[20,[10,5]]]],[[[22,[-1]],27],[[20,[10,5]]],[]],[[25,27],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],40],[[20,[10,5]]],[]],[[25,40],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],[24,[23]]],[[20,[10,5]]],[]],[[25,[24,[23]]],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],[24,[23]]],[[20,[10,5]]],[]],[[25,[24,[23]]],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],36],[[20,[10,5]]],[]],[[25,36],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],-2],[[20,[10,5]]],[],[[33,[32]]]],[[25,-1],[[20,[10,5]]],[[33,[32]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]]],62,[]],[25,62],[[46,[24,[23]]],[[20,[35,54]]]],[[46,[24,[23]]],[[20,[35,54]]]],[[47,-1],[[20,[10,5]]],[[48,[[24,[23]]],[[56,[[20,[35,54]]]]]]]],[[25,-1],[[20,[10,5]]],[[48,[[24,[23]]],[[56,[[20,[35,54]]]]]],49]],[[[22,[-1]],[24,[23]]],[[20,[35,5]]],[]],[[25,[24,[23]]],[[20,[35,5]]]],[[53,15],53],[[53,15],53],[[53,15],53],[[53,15],53],[[[22,[-1]]],[[20,[4,5]]],[]],[25,[[20,[4,5]]]],[[[22,[-1]]],[[20,[28,5]]],[]],[25,[[20,[28,5]]]],[[[22,[-1]]],[[20,[[3,[2]],5]]],[]],[25,[[20,[[3,[2]],5]]]],[[[22,[-1]]],[[20,[[3,[[24,[23]]]],5]]],[]],[25,[[20,[[3,[[24,[23]]]],5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]]],[[20,[57,5]]],[]],[25,[[20,[57,5]]]],[[[22,[-1]]],10,46],[25,10],[[[22,[-1]],29],[[20,[10,5]]],[]],[[25,29],[[20,[10,5]]]],[[[22,[-1]]],[[20,[4,5]]],[]],[25,[[20,[4,5]]]],[[[22,[-1]],57],[[20,[10,5]]],[]],[[25,57],[[20,[10,5]]]],[[27,15],27],[[46,63],41],[[46,63],41],[[47,-1],[[20,[10,5]]],[[48,[63],[[56,[41]]]]]],[[25,-1],[[20,[10,5]]],[[48,[63],[[56,[41]]]],49]],[[[22,[-1]],[24,[23]]],[[20,[35,5]]],[]],[[25,[24,[23]]],[[20,[35,5]]]],[[[22,[-1]],58],[[20,[10,5]]],[]],[[25,58],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],[24,[23]]],[[20,[10,5]]],[]],[[25,[24,[23]]],[[20,[10,5]]]],[[[22,[-1]],-2],[[20,[10,5]]],[],[[33,[32]]]],[[25,-1],[[20,[10,5]]],[[33,[32]]]],[[[22,[-1]],[24,[23]]],[[20,[10,5]]],[]],[[25,[24,[23]]],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[46,64],[[20,[10,5]]]],[[46,64],[[20,[10,5]]]],[[47,-1],[[20,[10,5]]],[[48,[64],[[56,[[20,[10,5]]]]]],49]],[[25,-1],[[20,[10,5]]],[[48,[64],[[56,[[20,[10,5]]]]]],49]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],-2],[[20,[10,5]]],[],[[33,[32]]]],[[25,-1],[[20,[10,5]]],[[33,[32]]]],[[[22,[-1]],[24,[23]]],[[20,[10,5]]],[]],[[25,[24,[23]]],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],40,40],[[20,[10,5]]],[]],[[25,40,40],[[20,[10,5]]]],[[[22,[-1]],27],[[20,[10,5]]],[]],[[25,27],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],40],[[20,[10,5]]],[]],[[25,40],[[20,[10,5]]]],[[[22,[-1]]],[[20,[28,5]]],[]],[25,[[20,[28,5]]]],[[[22,[-1]]],[[3,[19]]],[]],[25,[[3,[19]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],28],[[20,[10,5]]],[]],[[25,28],[[20,[10,5]]]],[[[22,[-1]],28],[[20,[10,5]]],[]],[[25,28],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],37],[[20,[10,5]]],[]],[[25,37],[[20,[10,5]]]],[[[22,[-1]]],[[20,[15,5]]],[]],[25,[[20,[15,5]]]],[[[22,[-1]],51],[[20,[10,5]]],[]],[[25,51],[[20,[10,5]]]],[[[22,[-1]],28],[[20,[10,5]]],[]],[[25,28],[[20,[10,5]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[22,[-1]]],[[20,[28,5]]],[]],[25,[[20,[28,5]]]],[25,47],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],[3,[-2]]],[[20,[10,5]]],[],[[33,[32]]]],[[25,[3,[-1]]],[[20,[10,5]]],[[33,[32]]]],[47,[[20,[10,5]]]],[[[22,[-1]]],[[20,[10,5]]],[]],[25,[[20,[10,5]]]],[47,[[20,[10,5]]]],[[[22,[-1]]],[[20,[10,5]]],[]],[25,[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[47,[[20,[10,5]]]],[[[22,[-1]]],[[20,[10,5]]],[]],[25,[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],35],[[20,[10,5]]],[]],[[25,35],[[20,[10,5]]]],[[[22,[-1]]],[[20,[45,5]]],[]],[25,[[20,[45,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],2],[[31,[23]]],[]],[[25,2],[[31,[23]]]],[[[22,[-1]],[24,[23]]],19,[]],[[25,[24,[23]]],19],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],2],[[20,[10,5]]],[]],[[25,2],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[[22,[-1]],15],[[20,[10,5]]],[]],[[25,15],[[20,[10,5]]]],[[46,[24,[23]]],[[20,[35,55]]]],[[46,[24,[23]]],[[20,[35,55]]]],[[47,-1],[[20,[10,5]]],[[48,[[24,[23]]],[[56,[[20,[35,55]]]]]]]],[[25,-1],[[20,[10,5]]],[[48,[[24,[23]]],[[56,[[20,[35,55]]]]]],49]],0,0,0,0,0,0,0,0,0,[[65,66,67],[[20,[4,7]]]],[[65,25],[[20,[68,7]]]],[[65,[22,[-1]]],[[20,[[69,[-1]],7]]],[]],[68,[[20,[28,5]]]],[[[69,[-1]]],[[20,[28,5]]],[]],[[65,66,35],[[20,[10,7]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[70,70],[[-1,-2],10,[],[]],[68,[[20,[28,5]]]],[[[69,[-1]]],[[20,[28,5]]],[]],[68,[[20,[45,5]]]],[[[69,[-1]]],[[20,[45,5]]],[]],[68,[[20,[[3,[2]],5]]]],[[[69,[-1]]],[[20,[[3,[2]],5]]],[]],[68,[[20,[[3,[[24,[23]]]],5]]]],[[[69,[-1]]],[[20,[[3,[[24,[23]]]],5]]],[]],[68,[[20,[29,5]]]],[[[69,[-1]]],[[20,[29,5]]],[]],[68,[[20,[45,5]]]],[[[69,[-1]]],[[20,[45,5]]],[]],[68,[[20,[[3,[2]],5]]]],[[[69,[-1]]],[[20,[[3,[2]],5]]],[]],[68,[[20,[[3,[[24,[23]]]],5]]]],[[[69,[-1]]],[[20,[[3,[[24,[23]]]],5]]],[]],[[67,15],67],[[65,[3,[71]],[3,[71]],[3,[71]]],[[20,[[3,[61]],7]]]],[68,[[20,[[3,[51]],5]]]],[[[69,[-1]]],[[20,[[3,[51]],5]]],[]],[[65,16],17],[[72,16],17],[[68,16],17],[[[69,[-1]],16],17,52],[[67,16],17],[[73,16],17],[[74,16],17],[[70,16],17],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[75,74],[-1,-1,[]],[[[69,[-1]]],-1,[]],[[[69,[-1]]],-1,[]],[65,[[20,[[3,[28]],7]]]],[68,[[20,[57,5]]]],[[[69,[-1]]],[[20,[57,5]]],[]],[68,[[20,[4,5]]]],[[[69,[-1]]],[[20,[4,5]]],[]],[[67,15],67],[73,15],[73,15],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[72,68],15],[[72,[69,[-1]]],15,[]],[68,[[20,[[3,[2]],5]]]],[[[69,[-1]]],[[20,[[3,[2]],5]]],[]],[68,[[20,[58,5]]]],[[[69,[-1]]],[[20,[58,5]]],[]],[[65,-1],10,[[48,[72]]]],[68,[[20,[28,5]]]],[[[69,[-1]]],[[20,[28,5]]],[]],[[],65],[[],67],[[],74],[68,[[20,[61,5]]]],[[[69,[-1]]],[[20,[61,5]]],[]],[[67,15],67],[73,15],[65,[[20,[4,7]]]],[[65,15,15],[[20,[10,7]]]],[[65,[24,[74]],28],[[20,[4,7]]]],[[74,15],74],[[74,15],74],[[74,15],74],[68,[[20,[28,5]]]],[[[69,[-1]]],[[20,[28,5]]],[]],[68,[[20,[[3,[2]],5]]]],[[[69,[-1]]],[[20,[[3,[2]],5]]],[]],[68,[[20,[58,5]]]],[[[69,[-1]]],[[20,[58,5]]],[]],[65,76],[68,62],[[[69,[-1]]],62,[]],[74,15],[74,15],[74,15],[68,[[20,[4,5]]]],[[[69,[-1]]],[[20,[4,5]]],[]],[68,[[20,[28,5]]]],[[[69,[-1]]],[[20,[28,5]]],[]],[68,[[20,[[3,[2]],5]]]],[[[69,[-1]]],[[20,[[3,[2]],5]]],[]],[68,[[20,[[3,[[24,[23]]]],5]]]],[[[69,[-1]]],[[20,[[3,[[24,[23]]]],5]]],[]],[[65,68],[[20,[25,7]]]],[73,15],[[65,[69,[-1]]],[[20,[[22,[-1]],7]]],[]],[68,[[20,[57,5]]]],[[[69,[-1]]],[[20,[57,5]]],[]],[68,[[20,[4,5]]]],[[[69,[-1]]],[[20,[4,5]]],[]],[72,[[3,[[20,[10,5]]]]]],[[72,68],[[3,[[20,[10,5]]]]]],[[72,[69,[-1]]],[[3,[[20,[10,5]]]]],[]],[[74,66],10],[[65,35],[[20,[10,7]]]],[[65,35],[[20,[10,7]]]],[[65,35],[[20,[10,7]]]],[[65,35],[[20,[10,7]]]],[[65,35],[[20,[10,7]]]],[[68,35],[[20,[10,5]]]],[[[69,[-1]],35],[[20,[10,5]]],[]],[[65,-1],[[20,[10,7]]],[[48,[66,73,35]],49]],[68,[[20,[28,5]]]],[[[69,[-1]]],[[20,[28,5]]],[]],[68,[[20,[15,5]]]],[[[69,[-1]]],[[20,[15,5]]],[]],[65,[[20,[4,7]]]],[[65,-1],[[20,[10,7]]],[[48,[[3,[28]]],[[56,[15]]]],49]],[-1,-2,[],[]],[72,[[20,[35,5]]]],[68,[[20,[28,5]]]],[[[69,[-1]]],[[20,[28,5]]],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,[[20,[-2]]],[],[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[68,[[20,[10,5]]]],[[[69,[-1]]],[[20,[10,5]]],[]],[68,[[20,[10,5]]]],[[[69,[-1]]],[[20,[10,5]]],[]],[[65,[24,[74]],28],[[20,[4,7]]]],[65,70],[70,[[20,[10,7]]]]],"c":[],"p":[[5,"Version",0],[1,"str"],[6,"Option",1102],[1,"u32"],[5,"Error",0],[5,"ShareError",0],[5,"MultiError",0],[5,"FormError",0],[5,"Protocols",0],[1,"tuple"],[8,"CURLcode",1103],[8,"CURLSHcode",1103],[8,"CURLMcode",1103],[8,"CURLFORMcode",1103],[1,"bool"],[5,"Formatter",1104],[8,"Result",1104],[5,"NulError",1105],[5,"String",1106],[6,"Result",1107],[5,"TypeId",1108],[5,"Easy2",219],[1,"u8"],[1,"slice"],[5,"Easy",219],[5,"Part",219],[5,"SslOpt",219],[5,"Duration",1109],[5,"List",219],[5,"Auth",219],[5,"Vec",1110],[5,"Path",1111],[10,"AsRef",1112],[10,"Sized",1113],[1,"usize"],[6,"ProxyType",219],[6,"TimeCondition",219],[6,"IpResolve",219],[6,"HttpVersion",219],[6,"SslVersion",219],[6,"SeekResult",219],[6,"InfoType",219],[6,"NetRc",219],[5,"Iter",219],[1,"f64"],[10,"Handler",219],[5,"Transfer",219],[10,"FnMut",1114],[10,"Send",1113],[5,"Form",219],[1,"i64"],[10,"Debug",1104],[5,"PostRedirections",219],[6,"ReadError",219],[6,"WriteError",219],[17,"Output"],[1,"u64"],[1,"u16"],[8,"c_int",1115],[8,"curl_socket_t",1103],[1,"i32"],[6,"CURL",1103],[6,"SeekFrom",1116],[6,"c_void",1117],[5,"Multi",912],[8,"Socket",912],[5,"Events",912],[5,"EasyHandle",912],[5,"Easy2Handle",912],[5,"MultiWaker",912],[5,"fd_set",1118],[5,"Message",912],[5,"SocketEvents",912],[5,"WaitFd",912],[5,"pollfd",1115],[6,"CURLM",1103]],"b":[[73,"impl-Display-for-Error"],[74,"impl-Debug-for-Error"],[75,"impl-Debug-for-ShareError"],[76,"impl-Display-for-ShareError"],[77,"impl-Display-for-MultiError"],[78,"impl-Debug-for-MultiError"],[79,"impl-Display-for-FormError"],[80,"impl-Debug-for-FormError"]]}]\ +]')); +if (typeof exports !== 'undefined') exports.searchIndex = searchIndex; +else if (window.initSearch) window.initSearch(searchIndex); diff --git a/settings.html b/settings.html new file mode 100644 index 000000000..6eccc6967 --- /dev/null +++ b/settings.html @@ -0,0 +1,2 @@ +Settings +

Rustdoc settings

Back
\ No newline at end of file diff --git a/src-files.js b/src-files.js new file mode 100644 index 000000000..ac1944ab1 --- /dev/null +++ b/src-files.js @@ -0,0 +1,4 @@ +var srcIndex = new Map(JSON.parse('[\ +["curl",["",[["easy",[],["form.rs","handle.rs","handler.rs","list.rs","mod.rs","windows.rs"]]],["error.rs","lib.rs","multi.rs","panic.rs","version.rs"]]]\ +]')); +createSrcSidebar(); diff --git a/src/curl/easy/form.rs.html b/src/curl/easy/form.rs.html new file mode 100644 index 000000000..734ef5465 --- /dev/null +++ b/src/curl/easy/form.rs.html @@ -0,0 +1,754 @@ +form.rs - source +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+
use std::ffi::CString;
+use std::fmt;
+use std::path::Path;
+use std::ptr;
+
+use crate::easy::{list, List};
+use crate::FormError;
+use curl_sys;
+
+/// Multipart/formdata for an HTTP POST request.
+///
+/// This structure is built up and then passed to the `Easy::httppost` method to
+/// be sent off with a request.
+pub struct Form {
+    head: *mut curl_sys::curl_httppost,
+    tail: *mut curl_sys::curl_httppost,
+    headers: Vec<List>,
+    buffers: Vec<Vec<u8>>,
+    strings: Vec<CString>,
+}
+
+/// One part in a multipart upload, added to a `Form`.
+pub struct Part<'form, 'data> {
+    form: &'form mut Form,
+    name: &'data str,
+    array: Vec<curl_sys::curl_forms>,
+    error: Option<FormError>,
+}
+
+pub fn raw(form: &Form) -> *mut curl_sys::curl_httppost {
+    form.head
+}
+
+impl Form {
+    /// Creates a new blank form ready for the addition of new data.
+    pub fn new() -> Form {
+        Form {
+            head: ptr::null_mut(),
+            tail: ptr::null_mut(),
+            headers: Vec::new(),
+            buffers: Vec::new(),
+            strings: Vec::new(),
+        }
+    }
+
+    /// Prepares adding a new part to this `Form`
+    ///
+    /// Note that the part is not actually added to the form until the `add`
+    /// method is called on `Part`, which may or may not fail.
+    pub fn part<'a, 'data>(&'a mut self, name: &'data str) -> Part<'a, 'data> {
+        Part {
+            error: None,
+            form: self,
+            name,
+            array: vec![curl_sys::curl_forms {
+                option: curl_sys::CURLFORM_END,
+                value: ptr::null_mut(),
+            }],
+        }
+    }
+}
+
+impl fmt::Debug for Form {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        // TODO: fill this out more
+        f.debug_struct("Form").field("fields", &"...").finish()
+    }
+}
+
+impl Drop for Form {
+    fn drop(&mut self) {
+        unsafe {
+            curl_sys::curl_formfree(self.head);
+        }
+    }
+}
+
+impl<'form, 'data> Part<'form, 'data> {
+    /// A pointer to the contents of this part, the actual data to send away.
+    pub fn contents(&mut self, contents: &'data [u8]) -> &mut Self {
+        let pos = self.array.len() - 1;
+
+        // curl has an oddity where if the length if 0 it will call strlen
+        // on the value.  This means that if someone wants to add empty form
+        // contents we need to make sure the buffer contains a null byte.
+        let ptr = if contents.is_empty() {
+            b"\x00"
+        } else {
+            contents
+        }
+        .as_ptr();
+
+        self.array.insert(
+            pos,
+            curl_sys::curl_forms {
+                option: curl_sys::CURLFORM_COPYCONTENTS,
+                value: ptr as *mut _,
+            },
+        );
+        self.array.insert(
+            pos + 1,
+            curl_sys::curl_forms {
+                option: curl_sys::CURLFORM_CONTENTSLENGTH,
+                value: contents.len() as *mut _,
+            },
+        );
+        self
+    }
+
+    /// Causes this file to be read and its contents used as data in this part
+    ///
+    /// This part does not automatically become a file upload part simply
+    /// because its data was read from a file.
+    ///
+    /// # Errors
+    ///
+    /// If the filename has any internal nul bytes or if on Windows it does not
+    /// contain a unicode filename then the `add` function will eventually
+    /// return an error.
+    pub fn file_content<P>(&mut self, file: P) -> &mut Self
+    where
+        P: AsRef<Path>,
+    {
+        self._file_content(file.as_ref())
+    }
+
+    fn _file_content(&mut self, file: &Path) -> &mut Self {
+        if let Some(bytes) = self.path2cstr(file) {
+            let pos = self.array.len() - 1;
+            self.array.insert(
+                pos,
+                curl_sys::curl_forms {
+                    option: curl_sys::CURLFORM_FILECONTENT,
+                    value: bytes.as_ptr() as *mut _,
+                },
+            );
+            self.form.strings.push(bytes);
+        }
+        self
+    }
+
+    /// Makes this part a file upload part of the given file.
+    ///
+    /// Sets the filename field to the basename of the provided file name, and
+    /// it reads the contents of the file and passes them as data and sets the
+    /// content type if the given file matches one of the internally known file
+    /// extensions.
+    ///
+    /// The given upload file must exist entirely on the filesystem before the
+    /// upload is started because libcurl needs to read the size of it
+    /// beforehand.
+    ///
+    /// Multiple files can be uploaded by calling this method multiple times and
+    /// content types can also be configured for each file (by calling that
+    /// next).
+    ///
+    /// # Errors
+    ///
+    /// If the filename has any internal nul bytes or if on Windows it does not
+    /// contain a unicode filename then this function will cause `add` to return
+    /// an error when called.
+    pub fn file<P: ?Sized>(&mut self, file: &'data P) -> &mut Self
+    where
+        P: AsRef<Path>,
+    {
+        self._file(file.as_ref())
+    }
+
+    fn _file(&mut self, file: &'data Path) -> &mut Self {
+        if let Some(bytes) = self.path2cstr(file) {
+            let pos = self.array.len() - 1;
+            self.array.insert(
+                pos,
+                curl_sys::curl_forms {
+                    option: curl_sys::CURLFORM_FILE,
+                    value: bytes.as_ptr() as *mut _,
+                },
+            );
+            self.form.strings.push(bytes);
+        }
+        self
+    }
+
+    /// Used in combination with `Part::file`, provides the content-type for
+    /// this part, possibly instead of choosing an internal one.
+    ///
+    /// # Panics
+    ///
+    /// This function will panic if `content_type` contains an internal nul
+    /// byte.
+    pub fn content_type(&mut self, content_type: &'data str) -> &mut Self {
+        if let Some(bytes) = self.bytes2cstr(content_type.as_bytes()) {
+            let pos = self.array.len() - 1;
+            self.array.insert(
+                pos,
+                curl_sys::curl_forms {
+                    option: curl_sys::CURLFORM_CONTENTTYPE,
+                    value: bytes.as_ptr() as *mut _,
+                },
+            );
+            self.form.strings.push(bytes);
+        }
+        self
+    }
+
+    /// Used in combination with `Part::file`, provides the filename for
+    /// this part instead of the actual one.
+    ///
+    /// # Errors
+    ///
+    /// If `name` contains an internal nul byte, or if on Windows the path is
+    /// not valid unicode then this function will return an error when `add` is
+    /// called.
+    pub fn filename<P: ?Sized>(&mut self, name: &'data P) -> &mut Self
+    where
+        P: AsRef<Path>,
+    {
+        self._filename(name.as_ref())
+    }
+
+    fn _filename(&mut self, name: &'data Path) -> &mut Self {
+        if let Some(bytes) = self.path2cstr(name) {
+            let pos = self.array.len() - 1;
+            self.array.insert(
+                pos,
+                curl_sys::curl_forms {
+                    option: curl_sys::CURLFORM_FILENAME,
+                    value: bytes.as_ptr() as *mut _,
+                },
+            );
+            self.form.strings.push(bytes);
+        }
+        self
+    }
+
+    /// This is used to provide a custom file upload part without using the
+    /// `file` method above.
+    ///
+    /// The first parameter is for the filename field and the second is the
+    /// in-memory contents.
+    ///
+    /// # Errors
+    ///
+    /// If `name` contains an internal nul byte, or if on Windows the path is
+    /// not valid unicode then this function will return an error when `add` is
+    /// called.
+    pub fn buffer<P: ?Sized>(&mut self, name: &'data P, data: Vec<u8>) -> &mut Self
+    where
+        P: AsRef<Path>,
+    {
+        self._buffer(name.as_ref(), data)
+    }
+
+    fn _buffer(&mut self, name: &'data Path, mut data: Vec<u8>) -> &mut Self {
+        if let Some(bytes) = self.path2cstr(name) {
+            // If `CURLFORM_BUFFERLENGTH` is set to `0`, libcurl will instead do a strlen() on the
+            // contents to figure out the size so we need to make sure the buffer is actually
+            // zero terminated.
+            let length = data.len();
+            if length == 0 {
+                data.push(0);
+            }
+
+            let pos = self.array.len() - 1;
+            self.array.insert(
+                pos,
+                curl_sys::curl_forms {
+                    option: curl_sys::CURLFORM_BUFFER,
+                    value: bytes.as_ptr() as *mut _,
+                },
+            );
+            self.form.strings.push(bytes);
+            self.array.insert(
+                pos + 1,
+                curl_sys::curl_forms {
+                    option: curl_sys::CURLFORM_BUFFERPTR,
+                    value: data.as_ptr() as *mut _,
+                },
+            );
+            self.array.insert(
+                pos + 2,
+                curl_sys::curl_forms {
+                    option: curl_sys::CURLFORM_BUFFERLENGTH,
+                    value: length as *mut _,
+                },
+            );
+            self.form.buffers.push(data);
+        }
+        self
+    }
+
+    /// Specifies extra headers for the form POST section.
+    ///
+    /// Appends the list of headers to those libcurl automatically generates.
+    pub fn content_header(&mut self, headers: List) -> &mut Self {
+        let pos = self.array.len() - 1;
+        self.array.insert(
+            pos,
+            curl_sys::curl_forms {
+                option: curl_sys::CURLFORM_CONTENTHEADER,
+                value: list::raw(&headers) as *mut _,
+            },
+        );
+        self.form.headers.push(headers);
+        self
+    }
+
+    /// Attempts to add this part to the `Form` that it was created from.
+    ///
+    /// If any error happens while adding, that error is returned, otherwise
+    /// `Ok(())` is returned.
+    pub fn add(&mut self) -> Result<(), FormError> {
+        if let Some(err) = self.error.clone() {
+            return Err(err);
+        }
+        let rc = unsafe {
+            curl_sys::curl_formadd(
+                &mut self.form.head,
+                &mut self.form.tail,
+                curl_sys::CURLFORM_COPYNAME,
+                self.name.as_ptr(),
+                curl_sys::CURLFORM_NAMELENGTH,
+                self.name.len(),
+                curl_sys::CURLFORM_ARRAY,
+                self.array.as_ptr(),
+                curl_sys::CURLFORM_END,
+            )
+        };
+        if rc == curl_sys::CURL_FORMADD_OK {
+            Ok(())
+        } else {
+            Err(FormError::new(rc))
+        }
+    }
+
+    #[cfg(unix)]
+    fn path2cstr(&mut self, p: &Path) -> Option<CString> {
+        use std::os::unix::prelude::*;
+        self.bytes2cstr(p.as_os_str().as_bytes())
+    }
+
+    #[cfg(windows)]
+    fn path2cstr(&mut self, p: &Path) -> Option<CString> {
+        match p.to_str() {
+            Some(bytes) => self.bytes2cstr(bytes.as_bytes()),
+            None if self.error.is_none() => {
+                // TODO: better error code
+                self.error = Some(FormError::new(curl_sys::CURL_FORMADD_INCOMPLETE));
+                None
+            }
+            None => None,
+        }
+    }
+
+    fn bytes2cstr(&mut self, bytes: &[u8]) -> Option<CString> {
+        match CString::new(bytes) {
+            Ok(c) => Some(c),
+            Err(..) if self.error.is_none() => {
+                // TODO: better error code
+                self.error = Some(FormError::new(curl_sys::CURL_FORMADD_INCOMPLETE));
+                None
+            }
+            Err(..) => None,
+        }
+    }
+}
+
+impl<'form, 'data> fmt::Debug for Part<'form, 'data> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        // TODO: fill this out more
+        f.debug_struct("Part")
+            .field("name", &self.name)
+            .field("form", &self.form)
+            .finish()
+    }
+}
+
\ No newline at end of file diff --git a/src/curl/easy/handle.rs.html b/src/curl/easy/handle.rs.html new file mode 100644 index 000000000..4d28f5227 --- /dev/null +++ b/src/curl/easy/handle.rs.html @@ -0,0 +1,3416 @@ +handle.rs - source +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+
use std::cell::Cell;
+use std::fmt;
+use std::io::SeekFrom;
+use std::path::Path;
+use std::ptr;
+use std::str;
+use std::time::Duration;
+
+use curl_sys;
+use libc::c_void;
+
+use crate::easy::handler::{self, InfoType, ReadError, SeekResult, WriteError};
+use crate::easy::handler::{Auth, NetRc, PostRedirections, ProxyType, SslOpt};
+use crate::easy::handler::{HttpVersion, IpResolve, SslVersion, TimeCondition};
+use crate::easy::{Easy2, Handler};
+use crate::easy::{Form, List};
+use crate::Error;
+
+/// Raw bindings to a libcurl "easy session".
+///
+/// This type is the same as the `Easy2` type in this library except that it
+/// does not contain a type parameter. Callbacks from curl are all controlled
+/// via closures on this `Easy` type, and this type namely has a `transfer`
+/// method as well for ergonomic management of these callbacks.
+///
+/// There's not necessarily a right answer for which type is correct to use, but
+/// as a general rule of thumb `Easy` is typically a reasonable choice for
+/// synchronous I/O and `Easy2` is a good choice for asynchronous I/O.
+///
+/// ## Examples
+///
+/// Creating a handle which can be used later
+///
+/// ```
+/// use curl::easy::Easy;
+///
+/// let handle = Easy::new();
+/// ```
+///
+/// Send an HTTP request, writing the response to stdout.
+///
+/// ```
+/// use std::io::{stdout, Write};
+///
+/// use curl::easy::Easy;
+///
+/// let mut handle = Easy::new();
+/// handle.url("https://www.rust-lang.org/").unwrap();
+/// handle.write_function(|data| {
+///     stdout().write_all(data).unwrap();
+///     Ok(data.len())
+/// }).unwrap();
+/// handle.perform().unwrap();
+/// ```
+///
+/// Collect all output of an HTTP request to a vector.
+///
+/// ```
+/// use curl::easy::Easy;
+///
+/// let mut data = Vec::new();
+/// let mut handle = Easy::new();
+/// handle.url("https://www.rust-lang.org/").unwrap();
+/// {
+///     let mut transfer = handle.transfer();
+///     transfer.write_function(|new_data| {
+///         data.extend_from_slice(new_data);
+///         Ok(new_data.len())
+///     }).unwrap();
+///     transfer.perform().unwrap();
+/// }
+/// println!("{:?}", data);
+/// ```
+///
+/// More examples of various properties of an HTTP request can be found on the
+/// specific methods as well.
+#[derive(Debug)]
+pub struct Easy {
+    inner: Easy2<EasyData>,
+}
+
+/// A scoped transfer of information which borrows an `Easy` and allows
+/// referencing stack-local data of the lifetime `'data`.
+///
+/// Usage of `Easy` requires the `'static` and `Send` bounds on all callbacks
+/// registered, but that's not often wanted if all you need is to collect a
+/// bunch of data in memory to a vector, for example. The `Transfer` structure,
+/// created by the `Easy::transfer` method, is used for this sort of request.
+///
+/// The callbacks attached to a `Transfer` are only active for that one transfer
+/// object, and they allow to elide both the `Send` and `'static` bounds to
+/// close over stack-local information.
+pub struct Transfer<'easy, 'data> {
+    easy: &'easy mut Easy,
+    data: Box<Callbacks<'data>>,
+}
+
+pub struct EasyData {
+    running: Cell<bool>,
+    owned: Callbacks<'static>,
+    borrowed: Cell<*mut Callbacks<'static>>,
+}
+
+unsafe impl Send for EasyData {}
+
+#[derive(Default)]
+struct Callbacks<'a> {
+    write: Option<Box<dyn FnMut(&[u8]) -> Result<usize, WriteError> + 'a>>,
+    read: Option<Box<dyn FnMut(&mut [u8]) -> Result<usize, ReadError> + 'a>>,
+    seek: Option<Box<dyn FnMut(SeekFrom) -> SeekResult + 'a>>,
+    debug: Option<Box<dyn FnMut(InfoType, &[u8]) + 'a>>,
+    header: Option<Box<dyn FnMut(&[u8]) -> bool + 'a>>,
+    progress: Option<Box<dyn FnMut(f64, f64, f64, f64) -> bool + 'a>>,
+    ssl_ctx: Option<Box<dyn FnMut(*mut c_void) -> Result<(), Error> + 'a>>,
+}
+
+impl Easy {
+    /// Creates a new "easy" handle which is the core of almost all operations
+    /// in libcurl.
+    ///
+    /// To use a handle, applications typically configure a number of options
+    /// followed by a call to `perform`. Options are preserved across calls to
+    /// `perform` and need to be reset manually (or via the `reset` method) if
+    /// this is not desired.
+    pub fn new() -> Easy {
+        Easy {
+            inner: Easy2::new(EasyData {
+                running: Cell::new(false),
+                owned: Callbacks::default(),
+                borrowed: Cell::new(ptr::null_mut()),
+            }),
+        }
+    }
+
+    // =========================================================================
+    // Behavior options
+
+    /// Same as [`Easy2::verbose`](struct.Easy2.html#method.verbose)
+    pub fn verbose(&mut self, verbose: bool) -> Result<(), Error> {
+        self.inner.verbose(verbose)
+    }
+
+    /// Same as [`Easy2::show_header`](struct.Easy2.html#method.show_header)
+    pub fn show_header(&mut self, show: bool) -> Result<(), Error> {
+        self.inner.show_header(show)
+    }
+
+    /// Same as [`Easy2::progress`](struct.Easy2.html#method.progress)
+    pub fn progress(&mut self, progress: bool) -> Result<(), Error> {
+        self.inner.progress(progress)
+    }
+
+    /// Same as [`Easy2::signal`](struct.Easy2.html#method.signal)
+    pub fn signal(&mut self, signal: bool) -> Result<(), Error> {
+        self.inner.signal(signal)
+    }
+
+    /// Same as [`Easy2::wildcard_match`](struct.Easy2.html#method.wildcard_match)
+    pub fn wildcard_match(&mut self, m: bool) -> Result<(), Error> {
+        self.inner.wildcard_match(m)
+    }
+
+    /// Same as [`Easy2::unix_socket`](struct.Easy2.html#method.unix_socket)
+    pub fn unix_socket(&mut self, unix_domain_socket: &str) -> Result<(), Error> {
+        self.inner.unix_socket(unix_domain_socket)
+    }
+
+    /// Same as [`Easy2::unix_socket_path`](struct.Easy2.html#method.unix_socket_path)
+    pub fn unix_socket_path<P: AsRef<Path>>(&mut self, path: Option<P>) -> Result<(), Error> {
+        self.inner.unix_socket_path(path)
+    }
+
+    /// Same as [`Easy2::abstract_unix_socket`](struct.Easy2.html#method.abstract_unix_socket)
+    ///
+    /// NOTE: this API can only be used on Linux OS.
+    #[cfg(target_os = "linux")]
+    pub fn abstract_unix_socket(&mut self, addr: &[u8]) -> Result<(), Error> {
+        self.inner.abstract_unix_socket(addr)
+    }
+
+    // =========================================================================
+    // Callback options
+
+    /// Set callback for writing received data.
+    ///
+    /// This callback function gets called by libcurl as soon as there is data
+    /// received that needs to be saved.
+    ///
+    /// The callback function will be passed as much data as possible in all
+    /// invokes, but you must not make any assumptions. It may be one byte, it
+    /// may be thousands. If `show_header` is enabled, which makes header data
+    /// get passed to the write callback, you can get up to
+    /// `CURL_MAX_HTTP_HEADER` bytes of header data passed into it.  This
+    /// usually means 100K.
+    ///
+    /// This function may be called with zero bytes data if the transferred file
+    /// is empty.
+    ///
+    /// The callback should return the number of bytes actually taken care of.
+    /// If that amount differs from the amount passed to your callback function,
+    /// it'll signal an error condition to the library. This will cause the
+    /// transfer to get aborted and the libcurl function used will return
+    /// an error with `is_write_error`.
+    ///
+    /// If your callback function returns `Err(WriteError::Pause)` it will cause
+    /// this transfer to become paused. See `unpause_write` for further details.
+    ///
+    /// By default data is sent into the void, and this corresponds to the
+    /// `CURLOPT_WRITEFUNCTION` and `CURLOPT_WRITEDATA` options.
+    ///
+    /// Note that the lifetime bound on this function is `'static`, but that
+    /// is often too restrictive. To use stack data consider calling the
+    /// `transfer` method and then using `write_function` to configure a
+    /// callback that can reference stack-local data.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::io::{stdout, Write};
+    /// use curl::easy::Easy;
+    ///
+    /// let mut handle = Easy::new();
+    /// handle.url("https://www.rust-lang.org/").unwrap();
+    /// handle.write_function(|data| {
+    ///     Ok(stdout().write(data).unwrap())
+    /// }).unwrap();
+    /// handle.perform().unwrap();
+    /// ```
+    ///
+    /// Writing to a stack-local buffer
+    ///
+    /// ```
+    /// use std::io::{stdout, Write};
+    /// use curl::easy::Easy;
+    ///
+    /// let mut buf = Vec::new();
+    /// let mut handle = Easy::new();
+    /// handle.url("https://www.rust-lang.org/").unwrap();
+    ///
+    /// let mut transfer = handle.transfer();
+    /// transfer.write_function(|data| {
+    ///     buf.extend_from_slice(data);
+    ///     Ok(data.len())
+    /// }).unwrap();
+    /// transfer.perform().unwrap();
+    /// ```
+    pub fn write_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(&[u8]) -> Result<usize, WriteError> + Send + 'static,
+    {
+        self.inner.get_mut().owned.write = Some(Box::new(f));
+        Ok(())
+    }
+
+    /// Read callback for data uploads.
+    ///
+    /// This callback function gets called by libcurl as soon as it needs to
+    /// read data in order to send it to the peer - like if you ask it to upload
+    /// or post data to the server.
+    ///
+    /// Your function must then return the actual number of bytes that it stored
+    /// in that memory area. Returning 0 will signal end-of-file to the library
+    /// and cause it to stop the current transfer.
+    ///
+    /// If you stop the current transfer by returning 0 "pre-maturely" (i.e
+    /// before the server expected it, like when you've said you will upload N
+    /// bytes and you upload less than N bytes), you may experience that the
+    /// server "hangs" waiting for the rest of the data that won't come.
+    ///
+    /// The read callback may return `Err(ReadError::Abort)` to stop the
+    /// current operation immediately, resulting in a `is_aborted_by_callback`
+    /// error code from the transfer.
+    ///
+    /// The callback can return `Err(ReadError::Pause)` to cause reading from
+    /// this connection to pause. See `unpause_read` for further details.
+    ///
+    /// By default data not input, and this corresponds to the
+    /// `CURLOPT_READFUNCTION` and `CURLOPT_READDATA` options.
+    ///
+    /// Note that the lifetime bound on this function is `'static`, but that
+    /// is often too restrictive. To use stack data consider calling the
+    /// `transfer` method and then using `read_function` to configure a
+    /// callback that can reference stack-local data.
+    ///
+    /// # Examples
+    ///
+    /// Read input from stdin
+    ///
+    /// ```no_run
+    /// use std::io::{stdin, Read};
+    /// use curl::easy::Easy;
+    ///
+    /// let mut handle = Easy::new();
+    /// handle.url("https://example.com/login").unwrap();
+    /// handle.read_function(|into| {
+    ///     Ok(stdin().read(into).unwrap())
+    /// }).unwrap();
+    /// handle.post(true).unwrap();
+    /// handle.perform().unwrap();
+    /// ```
+    ///
+    /// Reading from stack-local data:
+    ///
+    /// ```no_run
+    /// use std::io::{stdin, Read};
+    /// use curl::easy::Easy;
+    ///
+    /// let mut data_to_upload = &b"foobar"[..];
+    /// let mut handle = Easy::new();
+    /// handle.url("https://example.com/login").unwrap();
+    /// handle.post(true).unwrap();
+    ///
+    /// let mut transfer = handle.transfer();
+    /// transfer.read_function(|into| {
+    ///     Ok(data_to_upload.read(into).unwrap())
+    /// }).unwrap();
+    /// transfer.perform().unwrap();
+    /// ```
+    pub fn read_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(&mut [u8]) -> Result<usize, ReadError> + Send + 'static,
+    {
+        self.inner.get_mut().owned.read = Some(Box::new(f));
+        Ok(())
+    }
+
+    /// User callback for seeking in input stream.
+    ///
+    /// This function gets called by libcurl to seek to a certain position in
+    /// the input stream and can be used to fast forward a file in a resumed
+    /// upload (instead of reading all uploaded bytes with the normal read
+    /// function/callback). It is also called to rewind a stream when data has
+    /// already been sent to the server and needs to be sent again. This may
+    /// happen when doing a HTTP PUT or POST with a multi-pass authentication
+    /// method, or when an existing HTTP connection is reused too late and the
+    /// server closes the connection.
+    ///
+    /// The callback function must return `SeekResult::Ok` on success,
+    /// `SeekResult::Fail` to cause the upload operation to fail or
+    /// `SeekResult::CantSeek` to indicate that while the seek failed, libcurl
+    /// is free to work around the problem if possible. The latter can sometimes
+    /// be done by instead reading from the input or similar.
+    ///
+    /// By default data this option is not set, and this corresponds to the
+    /// `CURLOPT_SEEKFUNCTION` and `CURLOPT_SEEKDATA` options.
+    ///
+    /// Note that the lifetime bound on this function is `'static`, but that
+    /// is often too restrictive. To use stack data consider calling the
+    /// `transfer` method and then using `seek_function` to configure a
+    /// callback that can reference stack-local data.
+    pub fn seek_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(SeekFrom) -> SeekResult + Send + 'static,
+    {
+        self.inner.get_mut().owned.seek = Some(Box::new(f));
+        Ok(())
+    }
+
+    /// Callback to progress meter function
+    ///
+    /// This function gets called by libcurl instead of its internal equivalent
+    /// with a frequent interval. While data is being transferred it will be
+    /// called very frequently, and during slow periods like when nothing is
+    /// being transferred it can slow down to about one call per second.
+    ///
+    /// The callback gets told how much data libcurl will transfer and has
+    /// transferred, in number of bytes. The first argument is the total number
+    /// of bytes libcurl expects to download in this transfer. The second
+    /// argument is the number of bytes downloaded so far. The third argument is
+    /// the total number of bytes libcurl expects to upload in this transfer.
+    /// The fourth argument is the number of bytes uploaded so far.
+    ///
+    /// Unknown/unused argument values passed to the callback will be set to
+    /// zero (like if you only download data, the upload size will remain 0).
+    /// Many times the callback will be called one or more times first, before
+    /// it knows the data sizes so a program must be made to handle that.
+    ///
+    /// Returning `false` from this callback will cause libcurl to abort the
+    /// transfer and return `is_aborted_by_callback`.
+    ///
+    /// If you transfer data with the multi interface, this function will not be
+    /// called during periods of idleness unless you call the appropriate
+    /// libcurl function that performs transfers.
+    ///
+    /// `progress` must be set to `true` to make this function actually get
+    /// called.
+    ///
+    /// By default this function calls an internal method and corresponds to
+    /// `CURLOPT_PROGRESSFUNCTION` and `CURLOPT_PROGRESSDATA`.
+    ///
+    /// Note that the lifetime bound on this function is `'static`, but that
+    /// is often too restrictive. To use stack data consider calling the
+    /// `transfer` method and then using `progress_function` to configure a
+    /// callback that can reference stack-local data.
+    pub fn progress_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(f64, f64, f64, f64) -> bool + Send + 'static,
+    {
+        self.inner.get_mut().owned.progress = Some(Box::new(f));
+        Ok(())
+    }
+
+    /// Callback to SSL context
+    ///
+    /// This callback function gets called by libcurl just before the
+    /// initialization of an SSL connection after having processed all
+    /// other SSL related options to give a last chance to an
+    /// application to modify the behaviour of the SSL
+    /// initialization. The `ssl_ctx` parameter is actually a pointer
+    /// to the SSL library's SSL_CTX. If an error is returned from the
+    /// callback no attempt to establish a connection is made and the
+    /// perform operation will return the callback's error code.
+    ///
+    /// This function will get called on all new connections made to a
+    /// server, during the SSL negotiation. The SSL_CTX pointer will
+    /// be a new one every time.
+    ///
+    /// To use this properly, a non-trivial amount of knowledge of
+    /// your SSL library is necessary. For example, you can use this
+    /// function to call library-specific callbacks to add additional
+    /// validation code for certificates, and even to change the
+    /// actual URI of a HTTPS request.
+    ///
+    /// By default this function calls an internal method and
+    /// corresponds to `CURLOPT_SSL_CTX_FUNCTION` and
+    /// `CURLOPT_SSL_CTX_DATA`.
+    ///
+    /// Note that the lifetime bound on this function is `'static`, but that
+    /// is often too restrictive. To use stack data consider calling the
+    /// `transfer` method and then using `progress_function` to configure a
+    /// callback that can reference stack-local data.
+    pub fn ssl_ctx_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(*mut c_void) -> Result<(), Error> + Send + 'static,
+    {
+        self.inner.get_mut().owned.ssl_ctx = Some(Box::new(f));
+        Ok(())
+    }
+
+    /// Specify a debug callback
+    ///
+    /// `debug_function` replaces the standard debug function used when
+    /// `verbose` is in effect. This callback receives debug information,
+    /// as specified in the type argument.
+    ///
+    /// By default this option is not set and corresponds to the
+    /// `CURLOPT_DEBUGFUNCTION` and `CURLOPT_DEBUGDATA` options.
+    ///
+    /// Note that the lifetime bound on this function is `'static`, but that
+    /// is often too restrictive. To use stack data consider calling the
+    /// `transfer` method and then using `debug_function` to configure a
+    /// callback that can reference stack-local data.
+    pub fn debug_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(InfoType, &[u8]) + Send + 'static,
+    {
+        self.inner.get_mut().owned.debug = Some(Box::new(f));
+        Ok(())
+    }
+
+    /// Callback that receives header data
+    ///
+    /// This function gets called by libcurl as soon as it has received header
+    /// data. The header callback will be called once for each header and only
+    /// complete header lines are passed on to the callback. Parsing headers is
+    /// very easy using this. If this callback returns `false` it'll signal an
+    /// error to the library. This will cause the transfer to get aborted and
+    /// the libcurl function in progress will return `is_write_error`.
+    ///
+    /// A complete HTTP header that is passed to this function can be up to
+    /// CURL_MAX_HTTP_HEADER (100K) bytes.
+    ///
+    /// It's important to note that the callback will be invoked for the headers
+    /// of all responses received after initiating a request and not just the
+    /// final response. This includes all responses which occur during
+    /// authentication negotiation. If you need to operate on only the headers
+    /// from the final response, you will need to collect headers in the
+    /// callback yourself and use HTTP status lines, for example, to delimit
+    /// response boundaries.
+    ///
+    /// When a server sends a chunked encoded transfer, it may contain a
+    /// trailer. That trailer is identical to a HTTP header and if such a
+    /// trailer is received it is passed to the application using this callback
+    /// as well. There are several ways to detect it being a trailer and not an
+    /// ordinary header: 1) it comes after the response-body. 2) it comes after
+    /// the final header line (CR LF) 3) a Trailer: header among the regular
+    /// response-headers mention what header(s) to expect in the trailer.
+    ///
+    /// For non-HTTP protocols like FTP, POP3, IMAP and SMTP this function will
+    /// get called with the server responses to the commands that libcurl sends.
+    ///
+    /// By default this option is not set and corresponds to the
+    /// `CURLOPT_HEADERFUNCTION` and `CURLOPT_HEADERDATA` options.
+    ///
+    /// Note that the lifetime bound on this function is `'static`, but that
+    /// is often too restrictive. To use stack data consider calling the
+    /// `transfer` method and then using `header_function` to configure a
+    /// callback that can reference stack-local data.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::str;
+    ///
+    /// use curl::easy::Easy;
+    ///
+    /// let mut handle = Easy::new();
+    /// handle.url("https://www.rust-lang.org/").unwrap();
+    /// handle.header_function(|header| {
+    ///     print!("header: {}", str::from_utf8(header).unwrap());
+    ///     true
+    /// }).unwrap();
+    /// handle.perform().unwrap();
+    /// ```
+    ///
+    /// Collecting headers to a stack local vector
+    ///
+    /// ```
+    /// use std::str;
+    ///
+    /// use curl::easy::Easy;
+    ///
+    /// let mut headers = Vec::new();
+    /// let mut handle = Easy::new();
+    /// handle.url("https://www.rust-lang.org/").unwrap();
+    ///
+    /// {
+    ///     let mut transfer = handle.transfer();
+    ///     transfer.header_function(|header| {
+    ///         headers.push(str::from_utf8(header).unwrap().to_string());
+    ///         true
+    ///     }).unwrap();
+    ///     transfer.perform().unwrap();
+    /// }
+    ///
+    /// println!("{:?}", headers);
+    /// ```
+    pub fn header_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(&[u8]) -> bool + Send + 'static,
+    {
+        self.inner.get_mut().owned.header = Some(Box::new(f));
+        Ok(())
+    }
+
+    // =========================================================================
+    // Error options
+
+    // TODO: error buffer and stderr
+
+    /// Same as [`Easy2::fail_on_error`](struct.Easy2.html#method.fail_on_error)
+    pub fn fail_on_error(&mut self, fail: bool) -> Result<(), Error> {
+        self.inner.fail_on_error(fail)
+    }
+
+    // =========================================================================
+    // Network options
+
+    /// Same as [`Easy2::url`](struct.Easy2.html#method.url)
+    pub fn url(&mut self, url: &str) -> Result<(), Error> {
+        self.inner.url(url)
+    }
+
+    /// Same as [`Easy2::port`](struct.Easy2.html#method.port)
+    pub fn port(&mut self, port: u16) -> Result<(), Error> {
+        self.inner.port(port)
+    }
+
+    /// Same as [`Easy2::connect_to`](struct.Easy2.html#method.connect_to)
+    pub fn connect_to(&mut self, list: List) -> Result<(), Error> {
+        self.inner.connect_to(list)
+    }
+
+    /// Same as [`Easy2::path_as_is`](struct.Easy2.html#method.path_as_is)
+    pub fn path_as_is(&mut self, as_is: bool) -> Result<(), Error> {
+        self.inner.path_as_is(as_is)
+    }
+
+    /// Same as [`Easy2::proxy`](struct.Easy2.html#method.proxy)
+    pub fn proxy(&mut self, url: &str) -> Result<(), Error> {
+        self.inner.proxy(url)
+    }
+
+    /// Same as [`Easy2::proxy_port`](struct.Easy2.html#method.proxy_port)
+    pub fn proxy_port(&mut self, port: u16) -> Result<(), Error> {
+        self.inner.proxy_port(port)
+    }
+
+    /// Same as [`Easy2::proxy_cainfo`](struct.Easy2.html#method.proxy_cainfo)
+    pub fn proxy_cainfo(&mut self, cainfo: &str) -> Result<(), Error> {
+        self.inner.proxy_cainfo(cainfo)
+    }
+
+    /// Same as [`Easy2::proxy_capath`](struct.Easy2.html#method.proxy_capath)
+    pub fn proxy_capath<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.inner.proxy_capath(path)
+    }
+
+    /// Same as [`Easy2::proxy_sslcert`](struct.Easy2.html#method.proxy_sslcert)
+    pub fn proxy_sslcert(&mut self, sslcert: &str) -> Result<(), Error> {
+        self.inner.proxy_sslcert(sslcert)
+    }
+
+    /// Same as [`Easy2::proxy_sslcert_type`](struct.Easy2.html#method.proxy_sslcert_type)
+    pub fn proxy_sslcert_type(&mut self, kind: &str) -> Result<(), Error> {
+        self.inner.proxy_sslcert_type(kind)
+    }
+
+    /// Same as [`Easy2::proxy_sslcert_blob`](struct.Easy2.html#method.proxy_sslcert_blob)
+    pub fn proxy_sslcert_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.inner.proxy_sslcert_blob(blob)
+    }
+
+    /// Same as [`Easy2::proxy_sslkey`](struct.Easy2.html#method.proxy_sslkey)
+    pub fn proxy_sslkey(&mut self, sslkey: &str) -> Result<(), Error> {
+        self.inner.proxy_sslkey(sslkey)
+    }
+
+    /// Same as [`Easy2::proxy_sslkey_type`](struct.Easy2.html#method.proxy_sslkey_type)
+    pub fn proxy_sslkey_type(&mut self, kind: &str) -> Result<(), Error> {
+        self.inner.proxy_sslkey_type(kind)
+    }
+
+    /// Same as [`Easy2::proxy_sslkey_blob`](struct.Easy2.html#method.proxy_sslkey_blob)
+    pub fn proxy_sslkey_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.inner.proxy_sslkey_blob(blob)
+    }
+
+    /// Same as [`Easy2::proxy_key_password`](struct.Easy2.html#method.proxy_key_password)
+    pub fn proxy_key_password(&mut self, password: &str) -> Result<(), Error> {
+        self.inner.proxy_key_password(password)
+    }
+
+    /// Same as [`Easy2::proxy_type`](struct.Easy2.html#method.proxy_type)
+    pub fn proxy_type(&mut self, kind: ProxyType) -> Result<(), Error> {
+        self.inner.proxy_type(kind)
+    }
+
+    /// Same as [`Easy2::noproxy`](struct.Easy2.html#method.noproxy)
+    pub fn noproxy(&mut self, skip: &str) -> Result<(), Error> {
+        self.inner.noproxy(skip)
+    }
+
+    /// Same as [`Easy2::http_proxy_tunnel`](struct.Easy2.html#method.http_proxy_tunnel)
+    pub fn http_proxy_tunnel(&mut self, tunnel: bool) -> Result<(), Error> {
+        self.inner.http_proxy_tunnel(tunnel)
+    }
+
+    /// Same as [`Easy2::interface`](struct.Easy2.html#method.interface)
+    pub fn interface(&mut self, interface: &str) -> Result<(), Error> {
+        self.inner.interface(interface)
+    }
+
+    /// Same as [`Easy2::set_local_port`](struct.Easy2.html#method.set_local_port)
+    pub fn set_local_port(&mut self, port: u16) -> Result<(), Error> {
+        self.inner.set_local_port(port)
+    }
+
+    /// Same as [`Easy2::local_port_range`](struct.Easy2.html#method.local_port_range)
+    pub fn local_port_range(&mut self, range: u16) -> Result<(), Error> {
+        self.inner.local_port_range(range)
+    }
+
+    /// Same as [`Easy2::dns_servers`](struct.Easy2.html#method.dns_servers)
+    pub fn dns_servers(&mut self, servers: &str) -> Result<(), Error> {
+        self.inner.dns_servers(servers)
+    }
+
+    /// Same as [`Easy2::dns_cache_timeout`](struct.Easy2.html#method.dns_cache_timeout)
+    pub fn dns_cache_timeout(&mut self, dur: Duration) -> Result<(), Error> {
+        self.inner.dns_cache_timeout(dur)
+    }
+
+    /// Same as [`Easy2::doh_url`](struct.Easy2.html#method.doh_url)
+    pub fn doh_url(&mut self, url: Option<&str>) -> Result<(), Error> {
+        self.inner.doh_url(url)
+    }
+
+    /// Same as [`Easy2::doh_ssl_verify_peer`](struct.Easy2.html#method.doh_ssl_verify_peer)
+    pub fn doh_ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error> {
+        self.inner.doh_ssl_verify_peer(verify)
+    }
+
+    /// Same as [`Easy2::doh_ssl_verify_host`](struct.Easy2.html#method.doh_ssl_verify_host)
+    pub fn doh_ssl_verify_host(&mut self, verify: bool) -> Result<(), Error> {
+        self.inner.doh_ssl_verify_host(verify)
+    }
+
+    /// Same as [`Easy2::doh_ssl_verify_status`](struct.Easy2.html#method.doh_ssl_verify_status)
+    pub fn doh_ssl_verify_status(&mut self, verify: bool) -> Result<(), Error> {
+        self.inner.doh_ssl_verify_status(verify)
+    }
+
+    /// Same as [`Easy2::buffer_size`](struct.Easy2.html#method.buffer_size)
+    pub fn buffer_size(&mut self, size: usize) -> Result<(), Error> {
+        self.inner.buffer_size(size)
+    }
+
+    /// Same as [`Easy2::upload_buffer_size`](struct.Easy2.html#method.upload_buffer_size)
+    pub fn upload_buffer_size(&mut self, size: usize) -> Result<(), Error> {
+        self.inner.upload_buffer_size(size)
+    }
+
+    /// Same as [`Easy2::tcp_nodelay`](struct.Easy2.html#method.tcp_nodelay)
+    pub fn tcp_nodelay(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.tcp_nodelay(enable)
+    }
+
+    /// Same as [`Easy2::tcp_keepalive`](struct.Easy2.html#method.tcp_keepalive)
+    pub fn tcp_keepalive(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.tcp_keepalive(enable)
+    }
+
+    /// Same as [`Easy2::tcp_keepintvl`](struct.Easy2.html#method.tcp_keepalive)
+    pub fn tcp_keepintvl(&mut self, dur: Duration) -> Result<(), Error> {
+        self.inner.tcp_keepintvl(dur)
+    }
+
+    /// Same as [`Easy2::tcp_keepidle`](struct.Easy2.html#method.tcp_keepidle)
+    pub fn tcp_keepidle(&mut self, dur: Duration) -> Result<(), Error> {
+        self.inner.tcp_keepidle(dur)
+    }
+
+    /// Same as [`Easy2::address_scope`](struct.Easy2.html#method.address_scope)
+    pub fn address_scope(&mut self, scope: u32) -> Result<(), Error> {
+        self.inner.address_scope(scope)
+    }
+
+    // =========================================================================
+    // Names and passwords
+
+    /// Same as [`Easy2::username`](struct.Easy2.html#method.username)
+    pub fn username(&mut self, user: &str) -> Result<(), Error> {
+        self.inner.username(user)
+    }
+
+    /// Same as [`Easy2::password`](struct.Easy2.html#method.password)
+    pub fn password(&mut self, pass: &str) -> Result<(), Error> {
+        self.inner.password(pass)
+    }
+
+    /// Same as [`Easy2::http_auth`](struct.Easy2.html#method.http_auth)
+    pub fn http_auth(&mut self, auth: &Auth) -> Result<(), Error> {
+        self.inner.http_auth(auth)
+    }
+
+    /// Same as [`Easy2::aws_sigv4`](struct.Easy2.html#method.aws_sigv4)
+    pub fn aws_sigv4(&mut self, param: &str) -> Result<(), Error> {
+        self.inner.aws_sigv4(param)
+    }
+
+    /// Same as [`Easy2::proxy_username`](struct.Easy2.html#method.proxy_username)
+    pub fn proxy_username(&mut self, user: &str) -> Result<(), Error> {
+        self.inner.proxy_username(user)
+    }
+
+    /// Same as [`Easy2::proxy_password`](struct.Easy2.html#method.proxy_password)
+    pub fn proxy_password(&mut self, pass: &str) -> Result<(), Error> {
+        self.inner.proxy_password(pass)
+    }
+
+    /// Same as [`Easy2::proxy_auth`](struct.Easy2.html#method.proxy_auth)
+    pub fn proxy_auth(&mut self, auth: &Auth) -> Result<(), Error> {
+        self.inner.proxy_auth(auth)
+    }
+
+    /// Same as [`Easy2::netrc`](struct.Easy2.html#method.netrc)
+    pub fn netrc(&mut self, netrc: NetRc) -> Result<(), Error> {
+        self.inner.netrc(netrc)
+    }
+
+    // =========================================================================
+    // HTTP Options
+
+    /// Same as [`Easy2::autoreferer`](struct.Easy2.html#method.autoreferer)
+    pub fn autoreferer(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.autoreferer(enable)
+    }
+
+    /// Same as [`Easy2::accept_encoding`](struct.Easy2.html#method.accept_encoding)
+    pub fn accept_encoding(&mut self, encoding: &str) -> Result<(), Error> {
+        self.inner.accept_encoding(encoding)
+    }
+
+    /// Same as [`Easy2::transfer_encoding`](struct.Easy2.html#method.transfer_encoding)
+    pub fn transfer_encoding(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.transfer_encoding(enable)
+    }
+
+    /// Same as [`Easy2::follow_location`](struct.Easy2.html#method.follow_location)
+    pub fn follow_location(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.follow_location(enable)
+    }
+
+    /// Same as [`Easy2::unrestricted_auth`](struct.Easy2.html#method.unrestricted_auth)
+    pub fn unrestricted_auth(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.unrestricted_auth(enable)
+    }
+
+    /// Same as [`Easy2::max_redirections`](struct.Easy2.html#method.max_redirections)
+    pub fn max_redirections(&mut self, max: u32) -> Result<(), Error> {
+        self.inner.max_redirections(max)
+    }
+
+    /// Same as [`Easy2::post_redirections`](struct.Easy2.html#method.post_redirections)
+    pub fn post_redirections(&mut self, redirects: &PostRedirections) -> Result<(), Error> {
+        self.inner.post_redirections(redirects)
+    }
+
+    /// Same as [`Easy2::put`](struct.Easy2.html#method.put)
+    pub fn put(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.put(enable)
+    }
+
+    /// Same as [`Easy2::post`](struct.Easy2.html#method.post)
+    pub fn post(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.post(enable)
+    }
+
+    /// Same as [`Easy2::post_field_copy`](struct.Easy2.html#method.post_field_copy)
+    pub fn post_fields_copy(&mut self, data: &[u8]) -> Result<(), Error> {
+        self.inner.post_fields_copy(data)
+    }
+
+    /// Same as [`Easy2::post_field_size`](struct.Easy2.html#method.post_field_size)
+    pub fn post_field_size(&mut self, size: u64) -> Result<(), Error> {
+        self.inner.post_field_size(size)
+    }
+
+    /// Same as [`Easy2::httppost`](struct.Easy2.html#method.httppost)
+    pub fn httppost(&mut self, form: Form) -> Result<(), Error> {
+        self.inner.httppost(form)
+    }
+
+    /// Same as [`Easy2::referer`](struct.Easy2.html#method.referer)
+    pub fn referer(&mut self, referer: &str) -> Result<(), Error> {
+        self.inner.referer(referer)
+    }
+
+    /// Same as [`Easy2::useragent`](struct.Easy2.html#method.useragent)
+    pub fn useragent(&mut self, useragent: &str) -> Result<(), Error> {
+        self.inner.useragent(useragent)
+    }
+
+    /// Same as [`Easy2::http_headers`](struct.Easy2.html#method.http_headers)
+    pub fn http_headers(&mut self, list: List) -> Result<(), Error> {
+        self.inner.http_headers(list)
+    }
+
+    /// Same as [`Easy2::cookie`](struct.Easy2.html#method.cookie)
+    pub fn cookie(&mut self, cookie: &str) -> Result<(), Error> {
+        self.inner.cookie(cookie)
+    }
+
+    /// Same as [`Easy2::cookie_file`](struct.Easy2.html#method.cookie_file)
+    pub fn cookie_file<P: AsRef<Path>>(&mut self, file: P) -> Result<(), Error> {
+        self.inner.cookie_file(file)
+    }
+
+    /// Same as [`Easy2::cookie_jar`](struct.Easy2.html#method.cookie_jar)
+    pub fn cookie_jar<P: AsRef<Path>>(&mut self, file: P) -> Result<(), Error> {
+        self.inner.cookie_jar(file)
+    }
+
+    /// Same as [`Easy2::cookie_session`](struct.Easy2.html#method.cookie_session)
+    pub fn cookie_session(&mut self, session: bool) -> Result<(), Error> {
+        self.inner.cookie_session(session)
+    }
+
+    /// Same as [`Easy2::cookie_list`](struct.Easy2.html#method.cookie_list)
+    pub fn cookie_list(&mut self, cookie: &str) -> Result<(), Error> {
+        self.inner.cookie_list(cookie)
+    }
+
+    /// Same as [`Easy2::get`](struct.Easy2.html#method.get)
+    pub fn get(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.get(enable)
+    }
+
+    /// Same as [`Easy2::ignore_content_length`](struct.Easy2.html#method.ignore_content_length)
+    pub fn ignore_content_length(&mut self, ignore: bool) -> Result<(), Error> {
+        self.inner.ignore_content_length(ignore)
+    }
+
+    /// Same as [`Easy2::http_content_decoding`](struct.Easy2.html#method.http_content_decoding)
+    pub fn http_content_decoding(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.http_content_decoding(enable)
+    }
+
+    /// Same as [`Easy2::http_transfer_decoding`](struct.Easy2.html#method.http_transfer_decoding)
+    pub fn http_transfer_decoding(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.http_transfer_decoding(enable)
+    }
+
+    // =========================================================================
+    // Protocol Options
+
+    /// Same as [`Easy2::range`](struct.Easy2.html#method.range)
+    pub fn range(&mut self, range: &str) -> Result<(), Error> {
+        self.inner.range(range)
+    }
+
+    /// Same as [`Easy2::resume_from`](struct.Easy2.html#method.resume_from)
+    pub fn resume_from(&mut self, from: u64) -> Result<(), Error> {
+        self.inner.resume_from(from)
+    }
+
+    /// Same as [`Easy2::custom_request`](struct.Easy2.html#method.custom_request)
+    pub fn custom_request(&mut self, request: &str) -> Result<(), Error> {
+        self.inner.custom_request(request)
+    }
+
+    /// Same as [`Easy2::fetch_filetime`](struct.Easy2.html#method.fetch_filetime)
+    pub fn fetch_filetime(&mut self, fetch: bool) -> Result<(), Error> {
+        self.inner.fetch_filetime(fetch)
+    }
+
+    /// Same as [`Easy2::nobody`](struct.Easy2.html#method.nobody)
+    pub fn nobody(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.nobody(enable)
+    }
+
+    /// Same as [`Easy2::in_filesize`](struct.Easy2.html#method.in_filesize)
+    pub fn in_filesize(&mut self, size: u64) -> Result<(), Error> {
+        self.inner.in_filesize(size)
+    }
+
+    /// Same as [`Easy2::upload`](struct.Easy2.html#method.upload)
+    pub fn upload(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.upload(enable)
+    }
+
+    /// Same as [`Easy2::max_filesize`](struct.Easy2.html#method.max_filesize)
+    pub fn max_filesize(&mut self, size: u64) -> Result<(), Error> {
+        self.inner.max_filesize(size)
+    }
+
+    /// Same as [`Easy2::time_condition`](struct.Easy2.html#method.time_condition)
+    pub fn time_condition(&mut self, cond: TimeCondition) -> Result<(), Error> {
+        self.inner.time_condition(cond)
+    }
+
+    /// Same as [`Easy2::time_value`](struct.Easy2.html#method.time_value)
+    pub fn time_value(&mut self, val: i64) -> Result<(), Error> {
+        self.inner.time_value(val)
+    }
+
+    // =========================================================================
+    // Connection Options
+
+    /// Same as [`Easy2::timeout`](struct.Easy2.html#method.timeout)
+    pub fn timeout(&mut self, timeout: Duration) -> Result<(), Error> {
+        self.inner.timeout(timeout)
+    }
+
+    /// Same as [`Easy2::low_speed_limit`](struct.Easy2.html#method.low_speed_limit)
+    pub fn low_speed_limit(&mut self, limit: u32) -> Result<(), Error> {
+        self.inner.low_speed_limit(limit)
+    }
+
+    /// Same as [`Easy2::low_speed_time`](struct.Easy2.html#method.low_speed_time)
+    pub fn low_speed_time(&mut self, dur: Duration) -> Result<(), Error> {
+        self.inner.low_speed_time(dur)
+    }
+
+    /// Same as [`Easy2::max_send_speed`](struct.Easy2.html#method.max_send_speed)
+    pub fn max_send_speed(&mut self, speed: u64) -> Result<(), Error> {
+        self.inner.max_send_speed(speed)
+    }
+
+    /// Same as [`Easy2::max_recv_speed`](struct.Easy2.html#method.max_recv_speed)
+    pub fn max_recv_speed(&mut self, speed: u64) -> Result<(), Error> {
+        self.inner.max_recv_speed(speed)
+    }
+
+    /// Same as [`Easy2::max_connects`](struct.Easy2.html#method.max_connects)
+    pub fn max_connects(&mut self, max: u32) -> Result<(), Error> {
+        self.inner.max_connects(max)
+    }
+
+    /// Same as [`Easy2::maxage_conn`](struct.Easy2.html#method.maxage_conn)
+    pub fn maxage_conn(&mut self, max_age: Duration) -> Result<(), Error> {
+        self.inner.maxage_conn(max_age)
+    }
+
+    /// Same as [`Easy2::fresh_connect`](struct.Easy2.html#method.fresh_connect)
+    pub fn fresh_connect(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.fresh_connect(enable)
+    }
+
+    /// Same as [`Easy2::forbid_reuse`](struct.Easy2.html#method.forbid_reuse)
+    pub fn forbid_reuse(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.forbid_reuse(enable)
+    }
+
+    /// Same as [`Easy2::connect_timeout`](struct.Easy2.html#method.connect_timeout)
+    pub fn connect_timeout(&mut self, timeout: Duration) -> Result<(), Error> {
+        self.inner.connect_timeout(timeout)
+    }
+
+    /// Same as [`Easy2::ip_resolve`](struct.Easy2.html#method.ip_resolve)
+    pub fn ip_resolve(&mut self, resolve: IpResolve) -> Result<(), Error> {
+        self.inner.ip_resolve(resolve)
+    }
+
+    /// Same as [`Easy2::resolve`](struct.Easy2.html#method.resolve)
+    pub fn resolve(&mut self, list: List) -> Result<(), Error> {
+        self.inner.resolve(list)
+    }
+
+    /// Same as [`Easy2::connect_only`](struct.Easy2.html#method.connect_only)
+    pub fn connect_only(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.connect_only(enable)
+    }
+
+    // =========================================================================
+    // SSL/Security Options
+
+    /// Same as [`Easy2::ssl_cert`](struct.Easy2.html#method.ssl_cert)
+    pub fn ssl_cert<P: AsRef<Path>>(&mut self, cert: P) -> Result<(), Error> {
+        self.inner.ssl_cert(cert)
+    }
+
+    /// Same as [`Easy2::ssl_cert_blob`](struct.Easy2.html#method.ssl_cert_blob)
+    pub fn ssl_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.inner.ssl_cert_blob(blob)
+    }
+
+    /// Same as [`Easy2::ssl_cert_type`](struct.Easy2.html#method.ssl_cert_type)
+    pub fn ssl_cert_type(&mut self, kind: &str) -> Result<(), Error> {
+        self.inner.ssl_cert_type(kind)
+    }
+
+    /// Same as [`Easy2::ssl_key`](struct.Easy2.html#method.ssl_key)
+    pub fn ssl_key<P: AsRef<Path>>(&mut self, key: P) -> Result<(), Error> {
+        self.inner.ssl_key(key)
+    }
+
+    /// Same as [`Easy2::ssl_key_blob`](struct.Easy2.html#method.ssl_key_blob)
+    pub fn ssl_key_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.inner.ssl_key_blob(blob)
+    }
+
+    /// Same as [`Easy2::ssl_key_type`](struct.Easy2.html#method.ssl_key_type)
+    pub fn ssl_key_type(&mut self, kind: &str) -> Result<(), Error> {
+        self.inner.ssl_key_type(kind)
+    }
+
+    /// Same as [`Easy2::key_password`](struct.Easy2.html#method.key_password)
+    pub fn key_password(&mut self, password: &str) -> Result<(), Error> {
+        self.inner.key_password(password)
+    }
+
+    /// Same as [`Easy2::ssl_cainfo_blob`](struct.Easy2.html#method.ssl_cainfo_blob)
+    pub fn ssl_cainfo_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.inner.ssl_cainfo_blob(blob)
+    }
+
+    /// Same as [`Easy2::proxy_ssl_cainfo_blob`](struct.Easy2.html#method.proxy_ssl_cainfo_blob)
+    pub fn proxy_ssl_cainfo_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.inner.proxy_ssl_cainfo_blob(blob)
+    }
+
+    /// Same as [`Easy2::ssl_engine`](struct.Easy2.html#method.ssl_engine)
+    pub fn ssl_engine(&mut self, engine: &str) -> Result<(), Error> {
+        self.inner.ssl_engine(engine)
+    }
+
+    /// Same as [`Easy2::ssl_engine_default`](struct.Easy2.html#method.ssl_engine_default)
+    pub fn ssl_engine_default(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.ssl_engine_default(enable)
+    }
+
+    /// Same as [`Easy2::http_version`](struct.Easy2.html#method.http_version)
+    pub fn http_version(&mut self, version: HttpVersion) -> Result<(), Error> {
+        self.inner.http_version(version)
+    }
+
+    /// Same as [`Easy2::ssl_version`](struct.Easy2.html#method.ssl_version)
+    pub fn ssl_version(&mut self, version: SslVersion) -> Result<(), Error> {
+        self.inner.ssl_version(version)
+    }
+
+    /// Same as [`Easy2::proxy_ssl_version`](struct.Easy2.html#method.proxy_ssl_version)
+    pub fn proxy_ssl_version(&mut self, version: SslVersion) -> Result<(), Error> {
+        self.inner.proxy_ssl_version(version)
+    }
+
+    /// Same as [`Easy2::ssl_min_max_version`](struct.Easy2.html#method.ssl_min_max_version)
+    pub fn ssl_min_max_version(
+        &mut self,
+        min_version: SslVersion,
+        max_version: SslVersion,
+    ) -> Result<(), Error> {
+        self.inner.ssl_min_max_version(min_version, max_version)
+    }
+
+    /// Same as [`Easy2::proxy_ssl_min_max_version`](struct.Easy2.html#method.proxy_ssl_min_max_version)
+    pub fn proxy_ssl_min_max_version(
+        &mut self,
+        min_version: SslVersion,
+        max_version: SslVersion,
+    ) -> Result<(), Error> {
+        self.inner
+            .proxy_ssl_min_max_version(min_version, max_version)
+    }
+
+    /// Same as [`Easy2::ssl_verify_host`](struct.Easy2.html#method.ssl_verify_host)
+    pub fn ssl_verify_host(&mut self, verify: bool) -> Result<(), Error> {
+        self.inner.ssl_verify_host(verify)
+    }
+
+    /// Same as [`Easy2::proxy_ssl_verify_host`](struct.Easy2.html#method.proxy_ssl_verify_host)
+    pub fn proxy_ssl_verify_host(&mut self, verify: bool) -> Result<(), Error> {
+        self.inner.proxy_ssl_verify_host(verify)
+    }
+
+    /// Same as [`Easy2::ssl_verify_peer`](struct.Easy2.html#method.ssl_verify_peer)
+    pub fn ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error> {
+        self.inner.ssl_verify_peer(verify)
+    }
+
+    /// Same as [`Easy2::proxy_ssl_verify_peer`](struct.Easy2.html#method.proxy_ssl_verify_peer)
+    pub fn proxy_ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error> {
+        self.inner.proxy_ssl_verify_peer(verify)
+    }
+
+    /// Same as [`Easy2::cainfo`](struct.Easy2.html#method.cainfo)
+    pub fn cainfo<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.inner.cainfo(path)
+    }
+
+    /// Same as [`Easy2::issuer_cert`](struct.Easy2.html#method.issuer_cert)
+    pub fn issuer_cert<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.inner.issuer_cert(path)
+    }
+
+    /// Same as [`Easy2::proxy_issuer_cert`](struct.Easy2.html#method.proxy_issuer_cert)
+    pub fn proxy_issuer_cert<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.inner.proxy_issuer_cert(path)
+    }
+
+    /// Same as [`Easy2::issuer_cert_blob`](struct.Easy2.html#method.issuer_cert_blob)
+    pub fn issuer_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.inner.issuer_cert_blob(blob)
+    }
+
+    /// Same as [`Easy2::proxy_issuer_cert_blob`](struct.Easy2.html#method.proxy_issuer_cert_blob)
+    pub fn proxy_issuer_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.inner.proxy_issuer_cert_blob(blob)
+    }
+
+    /// Same as [`Easy2::capath`](struct.Easy2.html#method.capath)
+    pub fn capath<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.inner.capath(path)
+    }
+
+    /// Same as [`Easy2::crlfile`](struct.Easy2.html#method.crlfile)
+    pub fn crlfile<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.inner.crlfile(path)
+    }
+
+    /// Same as [`Easy2::proxy_crlfile`](struct.Easy2.html#method.proxy_crlfile)
+    pub fn proxy_crlfile<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.inner.proxy_crlfile(path)
+    }
+
+    /// Same as [`Easy2::certinfo`](struct.Easy2.html#method.certinfo)
+    pub fn certinfo(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.certinfo(enable)
+    }
+
+    /// Same as [`Easy2::random_file`](struct.Easy2.html#method.random_file)
+    pub fn random_file<P: AsRef<Path>>(&mut self, p: P) -> Result<(), Error> {
+        self.inner.random_file(p)
+    }
+
+    /// Same as [`Easy2::egd_socket`](struct.Easy2.html#method.egd_socket)
+    pub fn egd_socket<P: AsRef<Path>>(&mut self, p: P) -> Result<(), Error> {
+        self.inner.egd_socket(p)
+    }
+
+    /// Same as [`Easy2::ssl_cipher_list`](struct.Easy2.html#method.ssl_cipher_list)
+    pub fn ssl_cipher_list(&mut self, ciphers: &str) -> Result<(), Error> {
+        self.inner.ssl_cipher_list(ciphers)
+    }
+
+    /// Same as [`Easy2::proxy_ssl_cipher_list`](struct.Easy2.html#method.proxy_ssl_cipher_list)
+    pub fn proxy_ssl_cipher_list(&mut self, ciphers: &str) -> Result<(), Error> {
+        self.inner.proxy_ssl_cipher_list(ciphers)
+    }
+
+    /// Same as [`Easy2::ssl_sessionid_cache`](struct.Easy2.html#method.ssl_sessionid_cache)
+    pub fn ssl_sessionid_cache(&mut self, enable: bool) -> Result<(), Error> {
+        self.inner.ssl_sessionid_cache(enable)
+    }
+
+    /// Same as [`Easy2::ssl_options`](struct.Easy2.html#method.ssl_options)
+    pub fn ssl_options(&mut self, bits: &SslOpt) -> Result<(), Error> {
+        self.inner.ssl_options(bits)
+    }
+
+    /// Same as [`Easy2::proxy_ssl_options`](struct.Easy2.html#method.proxy_ssl_options)
+    pub fn proxy_ssl_options(&mut self, bits: &SslOpt) -> Result<(), Error> {
+        self.inner.proxy_ssl_options(bits)
+    }
+
+    /// Same as [`Easy2::pinned_public_key`](struct.Easy2.html#method.pinned_public_key)
+    pub fn pinned_public_key(&mut self, pubkey: &str) -> Result<(), Error> {
+        self.inner.pinned_public_key(pubkey)
+    }
+
+    // =========================================================================
+    // getters
+
+    /// Same as [`Easy2::time_condition_unmet`](struct.Easy2.html#method.time_condition_unmet)
+    pub fn time_condition_unmet(&mut self) -> Result<bool, Error> {
+        self.inner.time_condition_unmet()
+    }
+
+    /// Same as [`Easy2::effective_url`](struct.Easy2.html#method.effective_url)
+    pub fn effective_url(&mut self) -> Result<Option<&str>, Error> {
+        self.inner.effective_url()
+    }
+
+    /// Same as [`Easy2::effective_url_bytes`](struct.Easy2.html#method.effective_url_bytes)
+    pub fn effective_url_bytes(&mut self) -> Result<Option<&[u8]>, Error> {
+        self.inner.effective_url_bytes()
+    }
+
+    /// Same as [`Easy2::response_code`](struct.Easy2.html#method.response_code)
+    pub fn response_code(&mut self) -> Result<u32, Error> {
+        self.inner.response_code()
+    }
+
+    /// Same as [`Easy2::http_connectcode`](struct.Easy2.html#method.http_connectcode)
+    pub fn http_connectcode(&mut self) -> Result<u32, Error> {
+        self.inner.http_connectcode()
+    }
+
+    /// Same as [`Easy2::filetime`](struct.Easy2.html#method.filetime)
+    pub fn filetime(&mut self) -> Result<Option<i64>, Error> {
+        self.inner.filetime()
+    }
+
+    /// Same as [`Easy2::download_size`](struct.Easy2.html#method.download_size)
+    pub fn download_size(&mut self) -> Result<f64, Error> {
+        self.inner.download_size()
+    }
+
+    /// Same as [`Easy2::upload_size`](struct.Easy2.html#method.upload_size)
+    pub fn upload_size(&mut self) -> Result<f64, Error> {
+        self.inner.upload_size()
+    }
+
+    /// Same as [`Easy2::content_length_download`](struct.Easy2.html#method.content_length_download)
+    pub fn content_length_download(&mut self) -> Result<f64, Error> {
+        self.inner.content_length_download()
+    }
+
+    /// Same as [`Easy2::total_time`](struct.Easy2.html#method.total_time)
+    pub fn total_time(&mut self) -> Result<Duration, Error> {
+        self.inner.total_time()
+    }
+
+    /// Same as [`Easy2::namelookup_time`](struct.Easy2.html#method.namelookup_time)
+    pub fn namelookup_time(&mut self) -> Result<Duration, Error> {
+        self.inner.namelookup_time()
+    }
+
+    /// Same as [`Easy2::connect_time`](struct.Easy2.html#method.connect_time)
+    pub fn connect_time(&mut self) -> Result<Duration, Error> {
+        self.inner.connect_time()
+    }
+
+    /// Same as [`Easy2::appconnect_time`](struct.Easy2.html#method.appconnect_time)
+    pub fn appconnect_time(&mut self) -> Result<Duration, Error> {
+        self.inner.appconnect_time()
+    }
+
+    /// Same as [`Easy2::pretransfer_time`](struct.Easy2.html#method.pretransfer_time)
+    pub fn pretransfer_time(&mut self) -> Result<Duration, Error> {
+        self.inner.pretransfer_time()
+    }
+
+    /// Same as [`Easy2::starttransfer_time`](struct.Easy2.html#method.starttransfer_time)
+    pub fn starttransfer_time(&mut self) -> Result<Duration, Error> {
+        self.inner.starttransfer_time()
+    }
+
+    /// Same as [`Easy2::redirect_time`](struct.Easy2.html#method.redirect_time)
+    pub fn redirect_time(&mut self) -> Result<Duration, Error> {
+        self.inner.redirect_time()
+    }
+
+    /// Same as [`Easy2::redirect_count`](struct.Easy2.html#method.redirect_count)
+    pub fn redirect_count(&mut self) -> Result<u32, Error> {
+        self.inner.redirect_count()
+    }
+
+    /// Same as [`Easy2::redirect_url`](struct.Easy2.html#method.redirect_url)
+    pub fn redirect_url(&mut self) -> Result<Option<&str>, Error> {
+        self.inner.redirect_url()
+    }
+
+    /// Same as [`Easy2::redirect_url_bytes`](struct.Easy2.html#method.redirect_url_bytes)
+    pub fn redirect_url_bytes(&mut self) -> Result<Option<&[u8]>, Error> {
+        self.inner.redirect_url_bytes()
+    }
+
+    /// Same as [`Easy2::header_size`](struct.Easy2.html#method.header_size)
+    pub fn header_size(&mut self) -> Result<u64, Error> {
+        self.inner.header_size()
+    }
+
+    /// Same as [`Easy2::request_size`](struct.Easy2.html#method.request_size)
+    pub fn request_size(&mut self) -> Result<u64, Error> {
+        self.inner.request_size()
+    }
+
+    /// Same as [`Easy2::content_type`](struct.Easy2.html#method.content_type)
+    pub fn content_type(&mut self) -> Result<Option<&str>, Error> {
+        self.inner.content_type()
+    }
+
+    /// Same as [`Easy2::content_type_bytes`](struct.Easy2.html#method.content_type_bytes)
+    pub fn content_type_bytes(&mut self) -> Result<Option<&[u8]>, Error> {
+        self.inner.content_type_bytes()
+    }
+
+    /// Same as [`Easy2::os_errno`](struct.Easy2.html#method.os_errno)
+    pub fn os_errno(&mut self) -> Result<i32, Error> {
+        self.inner.os_errno()
+    }
+
+    /// Same as [`Easy2::primary_ip`](struct.Easy2.html#method.primary_ip)
+    pub fn primary_ip(&mut self) -> Result<Option<&str>, Error> {
+        self.inner.primary_ip()
+    }
+
+    /// Same as [`Easy2::primary_port`](struct.Easy2.html#method.primary_port)
+    pub fn primary_port(&mut self) -> Result<u16, Error> {
+        self.inner.primary_port()
+    }
+
+    /// Same as [`Easy2::local_ip`](struct.Easy2.html#method.local_ip)
+    pub fn local_ip(&mut self) -> Result<Option<&str>, Error> {
+        self.inner.local_ip()
+    }
+
+    /// Same as [`Easy2::local_port`](struct.Easy2.html#method.local_port)
+    pub fn local_port(&mut self) -> Result<u16, Error> {
+        self.inner.local_port()
+    }
+
+    /// Same as [`Easy2::cookies`](struct.Easy2.html#method.cookies)
+    pub fn cookies(&mut self) -> Result<List, Error> {
+        self.inner.cookies()
+    }
+
+    /// Same as [`Easy2::pipewait`](struct.Easy2.html#method.pipewait)
+    pub fn pipewait(&mut self, wait: bool) -> Result<(), Error> {
+        self.inner.pipewait(wait)
+    }
+
+    /// Same as [`Easy2::http_09_allowed`](struct.Easy2.html#method.http_09_allowed)
+    pub fn http_09_allowed(&mut self, allow: bool) -> Result<(), Error> {
+        self.inner.http_09_allowed(allow)
+    }
+
+    // =========================================================================
+    // Other methods
+
+    /// Same as [`Easy2::perform`](struct.Easy2.html#method.perform)
+    pub fn perform(&self) -> Result<(), Error> {
+        assert!(self.inner.get_ref().borrowed.get().is_null());
+        self.do_perform()
+    }
+
+    fn do_perform(&self) -> Result<(), Error> {
+        // We don't allow recursive invocations of `perform` because we're
+        // invoking `FnMut`closures behind a `&self` pointer. This flag acts as
+        // our own `RefCell` borrow flag sorta.
+        if self.inner.get_ref().running.get() {
+            return Err(Error::new(curl_sys::CURLE_FAILED_INIT));
+        }
+
+        self.inner.get_ref().running.set(true);
+        struct Reset<'a>(&'a Cell<bool>);
+        impl<'a> Drop for Reset<'a> {
+            fn drop(&mut self) {
+                self.0.set(false);
+            }
+        }
+        let _reset = Reset(&self.inner.get_ref().running);
+
+        self.inner.perform()
+    }
+
+    /// Creates a new scoped transfer which can be used to set callbacks and
+    /// data which only live for the scope of the returned object.
+    ///
+    /// An `Easy` handle is often reused between different requests to cache
+    /// connections to servers, but often the lifetime of the data as part of
+    /// each transfer is unique. This function serves as an ability to share an
+    /// `Easy` across many transfers while ergonomically using possibly
+    /// stack-local data as part of each transfer.
+    ///
+    /// Configuration can be set on the `Easy` and then a `Transfer` can be
+    /// created to set scoped configuration (like callbacks). Finally, the
+    /// `perform` method on the `Transfer` function can be used.
+    ///
+    /// When the `Transfer` option is dropped then all configuration set on the
+    /// transfer itself will be reset.
+    pub fn transfer<'data, 'easy>(&'easy mut self) -> Transfer<'easy, 'data> {
+        assert!(!self.inner.get_ref().running.get());
+        Transfer {
+            data: Box::new(Callbacks::default()),
+            easy: self,
+        }
+    }
+
+    /// Same as [`Easy2::upkeep`](struct.Easy2.html#method.upkeep)
+    #[cfg(feature = "upkeep_7_62_0")]
+    pub fn upkeep(&self) -> Result<(), Error> {
+        self.inner.upkeep()
+    }
+
+    /// Same as [`Easy2::unpause_read`](struct.Easy2.html#method.unpause_read)
+    pub fn unpause_read(&self) -> Result<(), Error> {
+        self.inner.unpause_read()
+    }
+
+    /// Same as [`Easy2::unpause_write`](struct.Easy2.html#method.unpause_write)
+    pub fn unpause_write(&self) -> Result<(), Error> {
+        self.inner.unpause_write()
+    }
+
+    /// Same as [`Easy2::url_encode`](struct.Easy2.html#method.url_encode)
+    pub fn url_encode(&mut self, s: &[u8]) -> String {
+        self.inner.url_encode(s)
+    }
+
+    /// Same as [`Easy2::url_decode`](struct.Easy2.html#method.url_decode)
+    pub fn url_decode(&mut self, s: &str) -> Vec<u8> {
+        self.inner.url_decode(s)
+    }
+
+    /// Same as [`Easy2::reset`](struct.Easy2.html#method.reset)
+    pub fn reset(&mut self) {
+        self.inner.reset()
+    }
+
+    /// Same as [`Easy2::recv`](struct.Easy2.html#method.recv)
+    pub fn recv(&mut self, data: &mut [u8]) -> Result<usize, Error> {
+        self.inner.recv(data)
+    }
+
+    /// Same as [`Easy2::send`](struct.Easy2.html#method.send)
+    pub fn send(&mut self, data: &[u8]) -> Result<usize, Error> {
+        self.inner.send(data)
+    }
+
+    /// Same as [`Easy2::raw`](struct.Easy2.html#method.raw)
+    pub fn raw(&self) -> *mut curl_sys::CURL {
+        self.inner.raw()
+    }
+
+    /// Same as [`Easy2::take_error_buf`](struct.Easy2.html#method.take_error_buf)
+    pub fn take_error_buf(&self) -> Option<String> {
+        self.inner.take_error_buf()
+    }
+}
+
+impl EasyData {
+    /// An unsafe function to get the appropriate callback field.
+    ///
+    /// We can have callbacks configured from one of two different sources.
+    /// We could either have a callback from the `borrowed` field, callbacks on
+    /// an ephemeral `Transfer`, or the `owned` field which are `'static`
+    /// callbacks that live for the lifetime of this `EasyData`.
+    ///
+    /// The first set of callbacks are unsafe to access because they're actually
+    /// owned elsewhere and we're just aliasing. Additionally they don't
+    /// technically live long enough for us to access them, so they're hidden
+    /// behind unsafe pointers and casts.
+    ///
+    /// This function returns `&'a mut T` but that's actually somewhat of a lie.
+    /// The value should **not be stored to** nor should it be used for the full
+    /// lifetime of `'a`, but rather immediately in the local scope.
+    ///
+    /// Basically this is just intended to acquire a callback, invoke it, and
+    /// then stop. Nothing else. Super unsafe.
+    unsafe fn callback<'a, T, F>(&'a mut self, f: F) -> Option<&'a mut T>
+    where
+        F: for<'b> Fn(&'b mut Callbacks<'static>) -> &'b mut Option<T>,
+    {
+        let ptr = self.borrowed.get();
+        if !ptr.is_null() {
+            let val = f(&mut *ptr);
+            if val.is_some() {
+                return val.as_mut();
+            }
+        }
+        f(&mut self.owned).as_mut()
+    }
+}
+
+impl Handler for EasyData {
+    fn write(&mut self, data: &[u8]) -> Result<usize, WriteError> {
+        unsafe {
+            match self.callback(|s| &mut s.write) {
+                Some(write) => write(data),
+                None => Ok(data.len()),
+            }
+        }
+    }
+
+    fn read(&mut self, data: &mut [u8]) -> Result<usize, ReadError> {
+        unsafe {
+            match self.callback(|s| &mut s.read) {
+                Some(read) => read(data),
+                None => Ok(0),
+            }
+        }
+    }
+
+    fn seek(&mut self, whence: SeekFrom) -> SeekResult {
+        unsafe {
+            match self.callback(|s| &mut s.seek) {
+                Some(seek) => seek(whence),
+                None => SeekResult::CantSeek,
+            }
+        }
+    }
+
+    fn debug(&mut self, kind: InfoType, data: &[u8]) {
+        unsafe {
+            match self.callback(|s| &mut s.debug) {
+                Some(debug) => debug(kind, data),
+                None => handler::debug(kind, data),
+            }
+        }
+    }
+
+    fn header(&mut self, data: &[u8]) -> bool {
+        unsafe {
+            match self.callback(|s| &mut s.header) {
+                Some(header) => header(data),
+                None => true,
+            }
+        }
+    }
+
+    fn progress(&mut self, dltotal: f64, dlnow: f64, ultotal: f64, ulnow: f64) -> bool {
+        unsafe {
+            match self.callback(|s| &mut s.progress) {
+                Some(progress) => progress(dltotal, dlnow, ultotal, ulnow),
+                None => true,
+            }
+        }
+    }
+
+    fn ssl_ctx(&mut self, cx: *mut c_void) -> Result<(), Error> {
+        unsafe {
+            match self.callback(|s| &mut s.ssl_ctx) {
+                Some(ssl_ctx) => ssl_ctx(cx),
+                None => handler::ssl_ctx(cx),
+            }
+        }
+    }
+}
+
+impl fmt::Debug for EasyData {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        "callbacks ...".fmt(f)
+    }
+}
+
+impl<'easy, 'data> Transfer<'easy, 'data> {
+    /// Same as `Easy::write_function`, just takes a non `'static` lifetime
+    /// corresponding to the lifetime of this transfer.
+    pub fn write_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(&[u8]) -> Result<usize, WriteError> + 'data,
+    {
+        self.data.write = Some(Box::new(f));
+        Ok(())
+    }
+
+    /// Same as `Easy::read_function`, just takes a non `'static` lifetime
+    /// corresponding to the lifetime of this transfer.
+    pub fn read_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(&mut [u8]) -> Result<usize, ReadError> + 'data,
+    {
+        self.data.read = Some(Box::new(f));
+        Ok(())
+    }
+
+    /// Same as `Easy::seek_function`, just takes a non `'static` lifetime
+    /// corresponding to the lifetime of this transfer.
+    pub fn seek_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(SeekFrom) -> SeekResult + 'data,
+    {
+        self.data.seek = Some(Box::new(f));
+        Ok(())
+    }
+
+    /// Same as `Easy::progress_function`, just takes a non `'static` lifetime
+    /// corresponding to the lifetime of this transfer.
+    pub fn progress_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(f64, f64, f64, f64) -> bool + 'data,
+    {
+        self.data.progress = Some(Box::new(f));
+        Ok(())
+    }
+
+    /// Same as `Easy::ssl_ctx_function`, just takes a non `'static`
+    /// lifetime corresponding to the lifetime of this transfer.
+    pub fn ssl_ctx_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(*mut c_void) -> Result<(), Error> + Send + 'data,
+    {
+        self.data.ssl_ctx = Some(Box::new(f));
+        Ok(())
+    }
+
+    /// Same as `Easy::debug_function`, just takes a non `'static` lifetime
+    /// corresponding to the lifetime of this transfer.
+    pub fn debug_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(InfoType, &[u8]) + 'data,
+    {
+        self.data.debug = Some(Box::new(f));
+        Ok(())
+    }
+
+    /// Same as `Easy::header_function`, just takes a non `'static` lifetime
+    /// corresponding to the lifetime of this transfer.
+    pub fn header_function<F>(&mut self, f: F) -> Result<(), Error>
+    where
+        F: FnMut(&[u8]) -> bool + 'data,
+    {
+        self.data.header = Some(Box::new(f));
+        Ok(())
+    }
+
+    /// Same as `Easy::perform`.
+    pub fn perform(&self) -> Result<(), Error> {
+        let inner = self.easy.inner.get_ref();
+
+        // Note that we're casting a `&self` pointer to a `*mut`, and then
+        // during the invocation of this call we're going to invoke `FnMut`
+        // closures that we ourselves own.
+        //
+        // This should be ok, however, because `do_perform` checks for recursive
+        // invocations of `perform` and disallows them. Our type also isn't
+        // `Sync`.
+        inner.borrowed.set(&*self.data as *const _ as *mut _);
+
+        // Make sure to reset everything back to the way it was before when
+        // we're done.
+        struct Reset<'a>(&'a Cell<*mut Callbacks<'static>>);
+        impl<'a> Drop for Reset<'a> {
+            fn drop(&mut self) {
+                self.0.set(ptr::null_mut());
+            }
+        }
+        let _reset = Reset(&inner.borrowed);
+
+        self.easy.do_perform()
+    }
+
+    /// Same as `Easy::upkeep`
+    #[cfg(feature = "upkeep_7_62_0")]
+    pub fn upkeep(&self) -> Result<(), Error> {
+        self.easy.upkeep()
+    }
+
+    /// Same as `Easy::unpause_read`.
+    pub fn unpause_read(&self) -> Result<(), Error> {
+        self.easy.unpause_read()
+    }
+
+    /// Same as `Easy::unpause_write`
+    pub fn unpause_write(&self) -> Result<(), Error> {
+        self.easy.unpause_write()
+    }
+}
+
+impl<'easy, 'data> fmt::Debug for Transfer<'easy, 'data> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("Transfer")
+            .field("easy", &self.easy)
+            .finish()
+    }
+}
+
+impl<'easy, 'data> Drop for Transfer<'easy, 'data> {
+    fn drop(&mut self) {
+        // Extra double check to make sure we don't leak a pointer to ourselves.
+        assert!(self.easy.inner.get_ref().borrowed.get().is_null());
+    }
+}
+
\ No newline at end of file diff --git a/src/curl/easy/handler.rs.html b/src/curl/easy/handler.rs.html new file mode 100644 index 000000000..06ad6c28a --- /dev/null +++ b/src/curl/easy/handler.rs.html @@ -0,0 +1,7984 @@ +handler.rs - source +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+2334
+2335
+2336
+2337
+2338
+2339
+2340
+2341
+2342
+2343
+2344
+2345
+2346
+2347
+2348
+2349
+2350
+2351
+2352
+2353
+2354
+2355
+2356
+2357
+2358
+2359
+2360
+2361
+2362
+2363
+2364
+2365
+2366
+2367
+2368
+2369
+2370
+2371
+2372
+2373
+2374
+2375
+2376
+2377
+2378
+2379
+2380
+2381
+2382
+2383
+2384
+2385
+2386
+2387
+2388
+2389
+2390
+2391
+2392
+2393
+2394
+2395
+2396
+2397
+2398
+2399
+2400
+2401
+2402
+2403
+2404
+2405
+2406
+2407
+2408
+2409
+2410
+2411
+2412
+2413
+2414
+2415
+2416
+2417
+2418
+2419
+2420
+2421
+2422
+2423
+2424
+2425
+2426
+2427
+2428
+2429
+2430
+2431
+2432
+2433
+2434
+2435
+2436
+2437
+2438
+2439
+2440
+2441
+2442
+2443
+2444
+2445
+2446
+2447
+2448
+2449
+2450
+2451
+2452
+2453
+2454
+2455
+2456
+2457
+2458
+2459
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+2470
+2471
+2472
+2473
+2474
+2475
+2476
+2477
+2478
+2479
+2480
+2481
+2482
+2483
+2484
+2485
+2486
+2487
+2488
+2489
+2490
+2491
+2492
+2493
+2494
+2495
+2496
+2497
+2498
+2499
+2500
+2501
+2502
+2503
+2504
+2505
+2506
+2507
+2508
+2509
+2510
+2511
+2512
+2513
+2514
+2515
+2516
+2517
+2518
+2519
+2520
+2521
+2522
+2523
+2524
+2525
+2526
+2527
+2528
+2529
+2530
+2531
+2532
+2533
+2534
+2535
+2536
+2537
+2538
+2539
+2540
+2541
+2542
+2543
+2544
+2545
+2546
+2547
+2548
+2549
+2550
+2551
+2552
+2553
+2554
+2555
+2556
+2557
+2558
+2559
+2560
+2561
+2562
+2563
+2564
+2565
+2566
+2567
+2568
+2569
+2570
+2571
+2572
+2573
+2574
+2575
+2576
+2577
+2578
+2579
+2580
+2581
+2582
+2583
+2584
+2585
+2586
+2587
+2588
+2589
+2590
+2591
+2592
+2593
+2594
+2595
+2596
+2597
+2598
+2599
+2600
+2601
+2602
+2603
+2604
+2605
+2606
+2607
+2608
+2609
+2610
+2611
+2612
+2613
+2614
+2615
+2616
+2617
+2618
+2619
+2620
+2621
+2622
+2623
+2624
+2625
+2626
+2627
+2628
+2629
+2630
+2631
+2632
+2633
+2634
+2635
+2636
+2637
+2638
+2639
+2640
+2641
+2642
+2643
+2644
+2645
+2646
+2647
+2648
+2649
+2650
+2651
+2652
+2653
+2654
+2655
+2656
+2657
+2658
+2659
+2660
+2661
+2662
+2663
+2664
+2665
+2666
+2667
+2668
+2669
+2670
+2671
+2672
+2673
+2674
+2675
+2676
+2677
+2678
+2679
+2680
+2681
+2682
+2683
+2684
+2685
+2686
+2687
+2688
+2689
+2690
+2691
+2692
+2693
+2694
+2695
+2696
+2697
+2698
+2699
+2700
+2701
+2702
+2703
+2704
+2705
+2706
+2707
+2708
+2709
+2710
+2711
+2712
+2713
+2714
+2715
+2716
+2717
+2718
+2719
+2720
+2721
+2722
+2723
+2724
+2725
+2726
+2727
+2728
+2729
+2730
+2731
+2732
+2733
+2734
+2735
+2736
+2737
+2738
+2739
+2740
+2741
+2742
+2743
+2744
+2745
+2746
+2747
+2748
+2749
+2750
+2751
+2752
+2753
+2754
+2755
+2756
+2757
+2758
+2759
+2760
+2761
+2762
+2763
+2764
+2765
+2766
+2767
+2768
+2769
+2770
+2771
+2772
+2773
+2774
+2775
+2776
+2777
+2778
+2779
+2780
+2781
+2782
+2783
+2784
+2785
+2786
+2787
+2788
+2789
+2790
+2791
+2792
+2793
+2794
+2795
+2796
+2797
+2798
+2799
+2800
+2801
+2802
+2803
+2804
+2805
+2806
+2807
+2808
+2809
+2810
+2811
+2812
+2813
+2814
+2815
+2816
+2817
+2818
+2819
+2820
+2821
+2822
+2823
+2824
+2825
+2826
+2827
+2828
+2829
+2830
+2831
+2832
+2833
+2834
+2835
+2836
+2837
+2838
+2839
+2840
+2841
+2842
+2843
+2844
+2845
+2846
+2847
+2848
+2849
+2850
+2851
+2852
+2853
+2854
+2855
+2856
+2857
+2858
+2859
+2860
+2861
+2862
+2863
+2864
+2865
+2866
+2867
+2868
+2869
+2870
+2871
+2872
+2873
+2874
+2875
+2876
+2877
+2878
+2879
+2880
+2881
+2882
+2883
+2884
+2885
+2886
+2887
+2888
+2889
+2890
+2891
+2892
+2893
+2894
+2895
+2896
+2897
+2898
+2899
+2900
+2901
+2902
+2903
+2904
+2905
+2906
+2907
+2908
+2909
+2910
+2911
+2912
+2913
+2914
+2915
+2916
+2917
+2918
+2919
+2920
+2921
+2922
+2923
+2924
+2925
+2926
+2927
+2928
+2929
+2930
+2931
+2932
+2933
+2934
+2935
+2936
+2937
+2938
+2939
+2940
+2941
+2942
+2943
+2944
+2945
+2946
+2947
+2948
+2949
+2950
+2951
+2952
+2953
+2954
+2955
+2956
+2957
+2958
+2959
+2960
+2961
+2962
+2963
+2964
+2965
+2966
+2967
+2968
+2969
+2970
+2971
+2972
+2973
+2974
+2975
+2976
+2977
+2978
+2979
+2980
+2981
+2982
+2983
+2984
+2985
+2986
+2987
+2988
+2989
+2990
+2991
+2992
+2993
+2994
+2995
+2996
+2997
+2998
+2999
+3000
+3001
+3002
+3003
+3004
+3005
+3006
+3007
+3008
+3009
+3010
+3011
+3012
+3013
+3014
+3015
+3016
+3017
+3018
+3019
+3020
+3021
+3022
+3023
+3024
+3025
+3026
+3027
+3028
+3029
+3030
+3031
+3032
+3033
+3034
+3035
+3036
+3037
+3038
+3039
+3040
+3041
+3042
+3043
+3044
+3045
+3046
+3047
+3048
+3049
+3050
+3051
+3052
+3053
+3054
+3055
+3056
+3057
+3058
+3059
+3060
+3061
+3062
+3063
+3064
+3065
+3066
+3067
+3068
+3069
+3070
+3071
+3072
+3073
+3074
+3075
+3076
+3077
+3078
+3079
+3080
+3081
+3082
+3083
+3084
+3085
+3086
+3087
+3088
+3089
+3090
+3091
+3092
+3093
+3094
+3095
+3096
+3097
+3098
+3099
+3100
+3101
+3102
+3103
+3104
+3105
+3106
+3107
+3108
+3109
+3110
+3111
+3112
+3113
+3114
+3115
+3116
+3117
+3118
+3119
+3120
+3121
+3122
+3123
+3124
+3125
+3126
+3127
+3128
+3129
+3130
+3131
+3132
+3133
+3134
+3135
+3136
+3137
+3138
+3139
+3140
+3141
+3142
+3143
+3144
+3145
+3146
+3147
+3148
+3149
+3150
+3151
+3152
+3153
+3154
+3155
+3156
+3157
+3158
+3159
+3160
+3161
+3162
+3163
+3164
+3165
+3166
+3167
+3168
+3169
+3170
+3171
+3172
+3173
+3174
+3175
+3176
+3177
+3178
+3179
+3180
+3181
+3182
+3183
+3184
+3185
+3186
+3187
+3188
+3189
+3190
+3191
+3192
+3193
+3194
+3195
+3196
+3197
+3198
+3199
+3200
+3201
+3202
+3203
+3204
+3205
+3206
+3207
+3208
+3209
+3210
+3211
+3212
+3213
+3214
+3215
+3216
+3217
+3218
+3219
+3220
+3221
+3222
+3223
+3224
+3225
+3226
+3227
+3228
+3229
+3230
+3231
+3232
+3233
+3234
+3235
+3236
+3237
+3238
+3239
+3240
+3241
+3242
+3243
+3244
+3245
+3246
+3247
+3248
+3249
+3250
+3251
+3252
+3253
+3254
+3255
+3256
+3257
+3258
+3259
+3260
+3261
+3262
+3263
+3264
+3265
+3266
+3267
+3268
+3269
+3270
+3271
+3272
+3273
+3274
+3275
+3276
+3277
+3278
+3279
+3280
+3281
+3282
+3283
+3284
+3285
+3286
+3287
+3288
+3289
+3290
+3291
+3292
+3293
+3294
+3295
+3296
+3297
+3298
+3299
+3300
+3301
+3302
+3303
+3304
+3305
+3306
+3307
+3308
+3309
+3310
+3311
+3312
+3313
+3314
+3315
+3316
+3317
+3318
+3319
+3320
+3321
+3322
+3323
+3324
+3325
+3326
+3327
+3328
+3329
+3330
+3331
+3332
+3333
+3334
+3335
+3336
+3337
+3338
+3339
+3340
+3341
+3342
+3343
+3344
+3345
+3346
+3347
+3348
+3349
+3350
+3351
+3352
+3353
+3354
+3355
+3356
+3357
+3358
+3359
+3360
+3361
+3362
+3363
+3364
+3365
+3366
+3367
+3368
+3369
+3370
+3371
+3372
+3373
+3374
+3375
+3376
+3377
+3378
+3379
+3380
+3381
+3382
+3383
+3384
+3385
+3386
+3387
+3388
+3389
+3390
+3391
+3392
+3393
+3394
+3395
+3396
+3397
+3398
+3399
+3400
+3401
+3402
+3403
+3404
+3405
+3406
+3407
+3408
+3409
+3410
+3411
+3412
+3413
+3414
+3415
+3416
+3417
+3418
+3419
+3420
+3421
+3422
+3423
+3424
+3425
+3426
+3427
+3428
+3429
+3430
+3431
+3432
+3433
+3434
+3435
+3436
+3437
+3438
+3439
+3440
+3441
+3442
+3443
+3444
+3445
+3446
+3447
+3448
+3449
+3450
+3451
+3452
+3453
+3454
+3455
+3456
+3457
+3458
+3459
+3460
+3461
+3462
+3463
+3464
+3465
+3466
+3467
+3468
+3469
+3470
+3471
+3472
+3473
+3474
+3475
+3476
+3477
+3478
+3479
+3480
+3481
+3482
+3483
+3484
+3485
+3486
+3487
+3488
+3489
+3490
+3491
+3492
+3493
+3494
+3495
+3496
+3497
+3498
+3499
+3500
+3501
+3502
+3503
+3504
+3505
+3506
+3507
+3508
+3509
+3510
+3511
+3512
+3513
+3514
+3515
+3516
+3517
+3518
+3519
+3520
+3521
+3522
+3523
+3524
+3525
+3526
+3527
+3528
+3529
+3530
+3531
+3532
+3533
+3534
+3535
+3536
+3537
+3538
+3539
+3540
+3541
+3542
+3543
+3544
+3545
+3546
+3547
+3548
+3549
+3550
+3551
+3552
+3553
+3554
+3555
+3556
+3557
+3558
+3559
+3560
+3561
+3562
+3563
+3564
+3565
+3566
+3567
+3568
+3569
+3570
+3571
+3572
+3573
+3574
+3575
+3576
+3577
+3578
+3579
+3580
+3581
+3582
+3583
+3584
+3585
+3586
+3587
+3588
+3589
+3590
+3591
+3592
+3593
+3594
+3595
+3596
+3597
+3598
+3599
+3600
+3601
+3602
+3603
+3604
+3605
+3606
+3607
+3608
+3609
+3610
+3611
+3612
+3613
+3614
+3615
+3616
+3617
+3618
+3619
+3620
+3621
+3622
+3623
+3624
+3625
+3626
+3627
+3628
+3629
+3630
+3631
+3632
+3633
+3634
+3635
+3636
+3637
+3638
+3639
+3640
+3641
+3642
+3643
+3644
+3645
+3646
+3647
+3648
+3649
+3650
+3651
+3652
+3653
+3654
+3655
+3656
+3657
+3658
+3659
+3660
+3661
+3662
+3663
+3664
+3665
+3666
+3667
+3668
+3669
+3670
+3671
+3672
+3673
+3674
+3675
+3676
+3677
+3678
+3679
+3680
+3681
+3682
+3683
+3684
+3685
+3686
+3687
+3688
+3689
+3690
+3691
+3692
+3693
+3694
+3695
+3696
+3697
+3698
+3699
+3700
+3701
+3702
+3703
+3704
+3705
+3706
+3707
+3708
+3709
+3710
+3711
+3712
+3713
+3714
+3715
+3716
+3717
+3718
+3719
+3720
+3721
+3722
+3723
+3724
+3725
+3726
+3727
+3728
+3729
+3730
+3731
+3732
+3733
+3734
+3735
+3736
+3737
+3738
+3739
+3740
+3741
+3742
+3743
+3744
+3745
+3746
+3747
+3748
+3749
+3750
+3751
+3752
+3753
+3754
+3755
+3756
+3757
+3758
+3759
+3760
+3761
+3762
+3763
+3764
+3765
+3766
+3767
+3768
+3769
+3770
+3771
+3772
+3773
+3774
+3775
+3776
+3777
+3778
+3779
+3780
+3781
+3782
+3783
+3784
+3785
+3786
+3787
+3788
+3789
+3790
+3791
+3792
+3793
+3794
+3795
+3796
+3797
+3798
+3799
+3800
+3801
+3802
+3803
+3804
+3805
+3806
+3807
+3808
+3809
+3810
+3811
+3812
+3813
+3814
+3815
+3816
+3817
+3818
+3819
+3820
+3821
+3822
+3823
+3824
+3825
+3826
+3827
+3828
+3829
+3830
+3831
+3832
+3833
+3834
+3835
+3836
+3837
+3838
+3839
+3840
+3841
+3842
+3843
+3844
+3845
+3846
+3847
+3848
+3849
+3850
+3851
+3852
+3853
+3854
+3855
+3856
+3857
+3858
+3859
+3860
+3861
+3862
+3863
+3864
+3865
+3866
+3867
+3868
+3869
+3870
+3871
+3872
+3873
+3874
+3875
+3876
+3877
+3878
+3879
+3880
+3881
+3882
+3883
+3884
+3885
+3886
+3887
+3888
+3889
+3890
+3891
+3892
+3893
+3894
+3895
+3896
+3897
+3898
+3899
+3900
+3901
+3902
+3903
+3904
+3905
+3906
+3907
+3908
+3909
+3910
+3911
+3912
+3913
+3914
+3915
+3916
+3917
+3918
+3919
+3920
+3921
+3922
+3923
+3924
+3925
+3926
+3927
+3928
+3929
+3930
+3931
+3932
+3933
+3934
+3935
+3936
+3937
+3938
+3939
+3940
+3941
+3942
+3943
+3944
+3945
+3946
+3947
+3948
+3949
+3950
+3951
+3952
+3953
+3954
+3955
+3956
+3957
+3958
+3959
+3960
+3961
+3962
+3963
+3964
+3965
+3966
+3967
+3968
+3969
+3970
+3971
+3972
+3973
+3974
+3975
+3976
+3977
+3978
+3979
+3980
+3981
+3982
+3983
+3984
+3985
+3986
+3987
+3988
+3989
+3990
+3991
+
use std::cell::RefCell;
+use std::convert::TryFrom;
+use std::ffi::{CStr, CString};
+use std::fmt;
+use std::io::{self, SeekFrom, Write};
+use std::path::Path;
+use std::ptr;
+use std::slice;
+use std::str;
+use std::time::Duration;
+
+use curl_sys;
+use libc::{self, c_char, c_double, c_int, c_long, c_ulong, c_void, size_t};
+use socket2::Socket;
+
+use crate::easy::form;
+use crate::easy::list;
+use crate::easy::windows;
+use crate::easy::{Form, List};
+use crate::panic;
+use crate::Error;
+
+/// A trait for the various callbacks used by libcurl to invoke user code.
+///
+/// This trait represents all operations that libcurl can possibly invoke a
+/// client for code during an HTTP transaction. Each callback has a default
+/// "noop" implementation, the same as in libcurl. Types implementing this trait
+/// may simply override the relevant functions to learn about the callbacks
+/// they're interested in.
+///
+/// # Examples
+///
+/// ```
+/// use curl::easy::{Easy2, Handler, WriteError};
+///
+/// struct Collector(Vec<u8>);
+///
+/// impl Handler for Collector {
+///     fn write(&mut self, data: &[u8]) -> Result<usize, WriteError> {
+///         self.0.extend_from_slice(data);
+///         Ok(data.len())
+///     }
+/// }
+///
+/// let mut easy = Easy2::new(Collector(Vec::new()));
+/// easy.get(true).unwrap();
+/// easy.url("https://www.rust-lang.org/").unwrap();
+/// easy.perform().unwrap();
+///
+/// assert_eq!(easy.response_code().unwrap(), 200);
+/// let contents = easy.get_ref();
+/// println!("{}", String::from_utf8_lossy(&contents.0));
+/// ```
+pub trait Handler {
+    /// Callback invoked whenever curl has downloaded data for the application.
+    ///
+    /// This callback function gets called by libcurl as soon as there is data
+    /// received that needs to be saved.
+    ///
+    /// The callback function will be passed as much data as possible in all
+    /// invokes, but you must not make any assumptions. It may be one byte, it
+    /// may be thousands. If `show_header` is enabled, which makes header data
+    /// get passed to the write callback, you can get up to
+    /// `CURL_MAX_HTTP_HEADER` bytes of header data passed into it.  This
+    /// usually means 100K.
+    ///
+    /// This function may be called with zero bytes data if the transferred file
+    /// is empty.
+    ///
+    /// The callback should return the number of bytes actually taken care of.
+    /// If that amount differs from the amount passed to your callback function,
+    /// it'll signal an error condition to the library. This will cause the
+    /// transfer to get aborted and the libcurl function used will return
+    /// an error with `is_write_error`.
+    ///
+    /// If your callback function returns `Err(WriteError::Pause)` it will cause
+    /// this transfer to become paused. See `unpause_write` for further details.
+    ///
+    /// By default data is sent into the void, and this corresponds to the
+    /// `CURLOPT_WRITEFUNCTION` and `CURLOPT_WRITEDATA` options.
+    fn write(&mut self, data: &[u8]) -> Result<usize, WriteError> {
+        Ok(data.len())
+    }
+
+    /// Read callback for data uploads.
+    ///
+    /// This callback function gets called by libcurl as soon as it needs to
+    /// read data in order to send it to the peer - like if you ask it to upload
+    /// or post data to the server.
+    ///
+    /// Your function must then return the actual number of bytes that it stored
+    /// in that memory area. Returning 0 will signal end-of-file to the library
+    /// and cause it to stop the current transfer.
+    ///
+    /// If you stop the current transfer by returning 0 "pre-maturely" (i.e
+    /// before the server expected it, like when you've said you will upload N
+    /// bytes and you upload less than N bytes), you may experience that the
+    /// server "hangs" waiting for the rest of the data that won't come.
+    ///
+    /// The read callback may return `Err(ReadError::Abort)` to stop the
+    /// current operation immediately, resulting in a `is_aborted_by_callback`
+    /// error code from the transfer.
+    ///
+    /// The callback can return `Err(ReadError::Pause)` to cause reading from
+    /// this connection to pause. See `unpause_read` for further details.
+    ///
+    /// By default data not input, and this corresponds to the
+    /// `CURLOPT_READFUNCTION` and `CURLOPT_READDATA` options.
+    ///
+    /// Note that the lifetime bound on this function is `'static`, but that
+    /// is often too restrictive. To use stack data consider calling the
+    /// `transfer` method and then using `read_function` to configure a
+    /// callback that can reference stack-local data.
+    fn read(&mut self, data: &mut [u8]) -> Result<usize, ReadError> {
+        let _ = data; // ignore unused
+        Ok(0)
+    }
+
+    /// User callback for seeking in input stream.
+    ///
+    /// This function gets called by libcurl to seek to a certain position in
+    /// the input stream and can be used to fast forward a file in a resumed
+    /// upload (instead of reading all uploaded bytes with the normal read
+    /// function/callback). It is also called to rewind a stream when data has
+    /// already been sent to the server and needs to be sent again. This may
+    /// happen when doing a HTTP PUT or POST with a multi-pass authentication
+    /// method, or when an existing HTTP connection is reused too late and the
+    /// server closes the connection.
+    ///
+    /// The callback function must return `SeekResult::Ok` on success,
+    /// `SeekResult::Fail` to cause the upload operation to fail or
+    /// `SeekResult::CantSeek` to indicate that while the seek failed, libcurl
+    /// is free to work around the problem if possible. The latter can sometimes
+    /// be done by instead reading from the input or similar.
+    ///
+    /// By default data this option is not set, and this corresponds to the
+    /// `CURLOPT_SEEKFUNCTION` and `CURLOPT_SEEKDATA` options.
+    fn seek(&mut self, whence: SeekFrom) -> SeekResult {
+        let _ = whence; // ignore unused
+        SeekResult::CantSeek
+    }
+
+    /// Specify a debug callback
+    ///
+    /// `debug_function` replaces the standard debug function used when
+    /// `verbose` is in effect. This callback receives debug information,
+    /// as specified in the type argument.
+    ///
+    /// By default this option is not set and corresponds to the
+    /// `CURLOPT_DEBUGFUNCTION` and `CURLOPT_DEBUGDATA` options.
+    fn debug(&mut self, kind: InfoType, data: &[u8]) {
+        debug(kind, data)
+    }
+
+    /// Callback that receives header data
+    ///
+    /// This function gets called by libcurl as soon as it has received header
+    /// data. The header callback will be called once for each header and only
+    /// complete header lines are passed on to the callback. Parsing headers is
+    /// very easy using this. If this callback returns `false` it'll signal an
+    /// error to the library. This will cause the transfer to get aborted and
+    /// the libcurl function in progress will return `is_write_error`.
+    ///
+    /// A complete HTTP header that is passed to this function can be up to
+    /// CURL_MAX_HTTP_HEADER (100K) bytes.
+    ///
+    /// It's important to note that the callback will be invoked for the headers
+    /// of all responses received after initiating a request and not just the
+    /// final response. This includes all responses which occur during
+    /// authentication negotiation. If you need to operate on only the headers
+    /// from the final response, you will need to collect headers in the
+    /// callback yourself and use HTTP status lines, for example, to delimit
+    /// response boundaries.
+    ///
+    /// When a server sends a chunked encoded transfer, it may contain a
+    /// trailer. That trailer is identical to a HTTP header and if such a
+    /// trailer is received it is passed to the application using this callback
+    /// as well. There are several ways to detect it being a trailer and not an
+    /// ordinary header: 1) it comes after the response-body. 2) it comes after
+    /// the final header line (CR LF) 3) a Trailer: header among the regular
+    /// response-headers mention what header(s) to expect in the trailer.
+    ///
+    /// For non-HTTP protocols like FTP, POP3, IMAP and SMTP this function will
+    /// get called with the server responses to the commands that libcurl sends.
+    ///
+    /// By default this option is not set and corresponds to the
+    /// `CURLOPT_HEADERFUNCTION` and `CURLOPT_HEADERDATA` options.
+    fn header(&mut self, data: &[u8]) -> bool {
+        let _ = data; // ignore unused
+        true
+    }
+
+    /// Callback to progress meter function
+    ///
+    /// This function gets called by libcurl instead of its internal equivalent
+    /// with a frequent interval. While data is being transferred it will be
+    /// called very frequently, and during slow periods like when nothing is
+    /// being transferred it can slow down to about one call per second.
+    ///
+    /// The callback gets told how much data libcurl will transfer and has
+    /// transferred, in number of bytes. The first argument is the total number
+    /// of bytes libcurl expects to download in this transfer. The second
+    /// argument is the number of bytes downloaded so far. The third argument is
+    /// the total number of bytes libcurl expects to upload in this transfer.
+    /// The fourth argument is the number of bytes uploaded so far.
+    ///
+    /// Unknown/unused argument values passed to the callback will be set to
+    /// zero (like if you only download data, the upload size will remain 0).
+    /// Many times the callback will be called one or more times first, before
+    /// it knows the data sizes so a program must be made to handle that.
+    ///
+    /// Returning `false` from this callback will cause libcurl to abort the
+    /// transfer and return `is_aborted_by_callback`.
+    ///
+    /// If you transfer data with the multi interface, this function will not be
+    /// called during periods of idleness unless you call the appropriate
+    /// libcurl function that performs transfers.
+    ///
+    /// `progress` must be set to `true` to make this function actually get
+    /// called.
+    ///
+    /// By default this function calls an internal method and corresponds to
+    /// `CURLOPT_PROGRESSFUNCTION` and `CURLOPT_PROGRESSDATA`.
+    fn progress(&mut self, dltotal: f64, dlnow: f64, ultotal: f64, ulnow: f64) -> bool {
+        let _ = (dltotal, dlnow, ultotal, ulnow); // ignore unused
+        true
+    }
+
+    /// Callback to SSL context
+    ///
+    /// This callback function gets called by libcurl just before the
+    /// initialization of an SSL connection after having processed all
+    /// other SSL related options to give a last chance to an
+    /// application to modify the behaviour of the SSL
+    /// initialization. The `ssl_ctx` parameter is actually a pointer
+    /// to the SSL library's SSL_CTX. If an error is returned from the
+    /// callback no attempt to establish a connection is made and the
+    /// perform operation will return the callback's error code.
+    ///
+    /// This function will get called on all new connections made to a
+    /// server, during the SSL negotiation. The SSL_CTX pointer will
+    /// be a new one every time.
+    ///
+    /// To use this properly, a non-trivial amount of knowledge of
+    /// your SSL library is necessary. For example, you can use this
+    /// function to call library-specific callbacks to add additional
+    /// validation code for certificates, and even to change the
+    /// actual URI of a HTTPS request.
+    ///
+    /// By default this function calls an internal method and
+    /// corresponds to `CURLOPT_SSL_CTX_FUNCTION` and
+    /// `CURLOPT_SSL_CTX_DATA`.
+    ///
+    /// Note that this callback is not guaranteed to be called, not all versions
+    /// of libcurl support calling this callback.
+    fn ssl_ctx(&mut self, cx: *mut c_void) -> Result<(), Error> {
+        // By default, if we're on an OpenSSL enabled libcurl and we're on
+        // Windows, add the system's certificate store to OpenSSL's certificate
+        // store.
+        ssl_ctx(cx)
+    }
+
+    /// Callback to open sockets for libcurl.
+    ///
+    /// This callback function gets called by libcurl instead of the socket(2)
+    /// call. The callback function should return the newly created socket
+    /// or `None` in case no connection could be established or another
+    /// error was detected. Any additional `setsockopt(2)` calls can of course
+    /// be done on the socket at the user's discretion. A `None` return
+    /// value from the callback function will signal an unrecoverable error to
+    /// libcurl and it will return `is_couldnt_connect` from the function that
+    /// triggered this callback.
+    ///
+    /// By default this function opens a standard socket and
+    /// corresponds to `CURLOPT_OPENSOCKETFUNCTION `.
+    fn open_socket(
+        &mut self,
+        family: c_int,
+        socktype: c_int,
+        protocol: c_int,
+    ) -> Option<curl_sys::curl_socket_t> {
+        // Note that we override this to calling a function in `socket2` to
+        // ensure that we open all sockets with CLOEXEC. Otherwise if we rely on
+        // libcurl to open sockets it won't use CLOEXEC.
+        return Socket::new(family.into(), socktype.into(), Some(protocol.into()))
+            .ok()
+            .map(cvt);
+
+        #[cfg(unix)]
+        fn cvt(socket: Socket) -> curl_sys::curl_socket_t {
+            use std::os::unix::prelude::*;
+            socket.into_raw_fd()
+        }
+
+        #[cfg(windows)]
+        fn cvt(socket: Socket) -> curl_sys::curl_socket_t {
+            use std::os::windows::prelude::*;
+            socket.into_raw_socket()
+        }
+    }
+}
+
+pub fn debug(kind: InfoType, data: &[u8]) {
+    let out = io::stderr();
+    let prefix = match kind {
+        InfoType::Text => "*",
+        InfoType::HeaderIn => "<",
+        InfoType::HeaderOut => ">",
+        InfoType::DataIn | InfoType::SslDataIn => "{",
+        InfoType::DataOut | InfoType::SslDataOut => "}",
+    };
+    let mut out = out.lock();
+    drop(write!(out, "{} ", prefix));
+    match str::from_utf8(data) {
+        Ok(s) => drop(out.write_all(s.as_bytes())),
+        Err(_) => drop(writeln!(out, "({} bytes of data)", data.len())),
+    }
+}
+
+pub fn ssl_ctx(cx: *mut c_void) -> Result<(), Error> {
+    windows::add_certs_to_context(cx);
+    Ok(())
+}
+
+/// Raw bindings to a libcurl "easy session".
+///
+/// This type corresponds to the `CURL` type in libcurl, and is probably what
+/// you want for just sending off a simple HTTP request and fetching a response.
+/// Each easy handle can be thought of as a large builder before calling the
+/// final `perform` function.
+///
+/// There are many many configuration options for each `Easy2` handle, and they
+/// should all have their own documentation indicating what it affects and how
+/// it interacts with other options. Some implementations of libcurl can use
+/// this handle to interact with many different protocols, although by default
+/// this crate only guarantees the HTTP/HTTPS protocols working.
+///
+/// Note that almost all methods on this structure which configure various
+/// properties return a `Result`. This is largely used to detect whether the
+/// underlying implementation of libcurl actually implements the option being
+/// requested. If you're linked to a version of libcurl which doesn't support
+/// the option, then an error will be returned. Some options also perform some
+/// validation when they're set, and the error is returned through this vector.
+///
+/// Note that historically this library contained an `Easy` handle so this one's
+/// called `Easy2`. The major difference between the `Easy` type is that an
+/// `Easy2` structure uses a trait instead of closures for all of the callbacks
+/// that curl can invoke. The `Easy` type is actually built on top of this
+/// `Easy` type, and this `Easy2` type can be more flexible in some situations
+/// due to the generic parameter.
+///
+/// There's not necessarily a right answer for which type is correct to use, but
+/// as a general rule of thumb `Easy` is typically a reasonable choice for
+/// synchronous I/O and `Easy2` is a good choice for asynchronous I/O.
+///
+/// # Examples
+///
+/// ```
+/// use curl::easy::{Easy2, Handler, WriteError};
+///
+/// struct Collector(Vec<u8>);
+///
+/// impl Handler for Collector {
+///     fn write(&mut self, data: &[u8]) -> Result<usize, WriteError> {
+///         self.0.extend_from_slice(data);
+///         Ok(data.len())
+///     }
+/// }
+///
+/// let mut easy = Easy2::new(Collector(Vec::new()));
+/// easy.get(true).unwrap();
+/// easy.url("https://www.rust-lang.org/").unwrap();
+/// easy.perform().unwrap();
+///
+/// assert_eq!(easy.response_code().unwrap(), 200);
+/// let contents = easy.get_ref();
+/// println!("{}", String::from_utf8_lossy(&contents.0));
+/// ```
+pub struct Easy2<H> {
+    inner: Box<Inner<H>>,
+}
+
+struct Inner<H> {
+    handle: *mut curl_sys::CURL,
+    header_list: Option<List>,
+    resolve_list: Option<List>,
+    connect_to_list: Option<List>,
+    form: Option<Form>,
+    error_buf: RefCell<Vec<u8>>,
+    handler: H,
+}
+
+unsafe impl<H: Send> Send for Inner<H> {}
+
+/// Possible proxy types that libcurl currently understands.
+#[non_exhaustive]
+#[allow(missing_docs)]
+#[derive(Debug, Clone, Copy)]
+pub enum ProxyType {
+    Http = curl_sys::CURLPROXY_HTTP as isize,
+    Http1 = curl_sys::CURLPROXY_HTTP_1_0 as isize,
+    Socks4 = curl_sys::CURLPROXY_SOCKS4 as isize,
+    Socks5 = curl_sys::CURLPROXY_SOCKS5 as isize,
+    Socks4a = curl_sys::CURLPROXY_SOCKS4A as isize,
+    Socks5Hostname = curl_sys::CURLPROXY_SOCKS5_HOSTNAME as isize,
+}
+
+/// Possible conditions for the `time_condition` method.
+#[non_exhaustive]
+#[allow(missing_docs)]
+#[derive(Debug, Clone, Copy)]
+pub enum TimeCondition {
+    None = curl_sys::CURL_TIMECOND_NONE as isize,
+    IfModifiedSince = curl_sys::CURL_TIMECOND_IFMODSINCE as isize,
+    IfUnmodifiedSince = curl_sys::CURL_TIMECOND_IFUNMODSINCE as isize,
+    LastModified = curl_sys::CURL_TIMECOND_LASTMOD as isize,
+}
+
+/// Possible values to pass to the `ip_resolve` method.
+#[non_exhaustive]
+#[allow(missing_docs)]
+#[derive(Debug, Clone, Copy)]
+pub enum IpResolve {
+    V4 = curl_sys::CURL_IPRESOLVE_V4 as isize,
+    V6 = curl_sys::CURL_IPRESOLVE_V6 as isize,
+    Any = curl_sys::CURL_IPRESOLVE_WHATEVER as isize,
+}
+
+/// Possible values to pass to the `http_version` method.
+#[non_exhaustive]
+#[derive(Debug, Clone, Copy)]
+pub enum HttpVersion {
+    /// We don't care what http version to use, and we'd like the library to
+    /// choose the best possible for us.
+    Any = curl_sys::CURL_HTTP_VERSION_NONE as isize,
+
+    /// Please use HTTP 1.0 in the request
+    V10 = curl_sys::CURL_HTTP_VERSION_1_0 as isize,
+
+    /// Please use HTTP 1.1 in the request
+    V11 = curl_sys::CURL_HTTP_VERSION_1_1 as isize,
+
+    /// Please use HTTP 2 in the request
+    /// (Added in CURL 7.33.0)
+    V2 = curl_sys::CURL_HTTP_VERSION_2_0 as isize,
+
+    /// Use version 2 for HTTPS, version 1.1 for HTTP
+    /// (Added in CURL 7.47.0)
+    V2TLS = curl_sys::CURL_HTTP_VERSION_2TLS as isize,
+
+    /// Please use HTTP 2 without HTTP/1.1 Upgrade
+    /// (Added in CURL 7.49.0)
+    V2PriorKnowledge = curl_sys::CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE as isize,
+
+    /// Setting this value will make libcurl attempt to use HTTP/3 directly to
+    /// server given in the URL but fallback to earlier HTTP versions if the HTTP/3
+    /// connection establishment fails.
+    ///
+    /// Note: the meaning of this settings depends on the linked libcurl.
+    /// For CURL < 7.88.0, there is no fallback if HTTP/3 connection fails.
+    ///
+    /// (Added in CURL 7.66.0)
+    V3 = curl_sys::CURL_HTTP_VERSION_3 as isize,
+}
+
+/// Possible values to pass to the `ssl_version` and `ssl_min_max_version` method.
+#[non_exhaustive]
+#[allow(missing_docs)]
+#[derive(Debug, Clone, Copy)]
+pub enum SslVersion {
+    Default = curl_sys::CURL_SSLVERSION_DEFAULT as isize,
+    Tlsv1 = curl_sys::CURL_SSLVERSION_TLSv1 as isize,
+    Sslv2 = curl_sys::CURL_SSLVERSION_SSLv2 as isize,
+    Sslv3 = curl_sys::CURL_SSLVERSION_SSLv3 as isize,
+    Tlsv10 = curl_sys::CURL_SSLVERSION_TLSv1_0 as isize,
+    Tlsv11 = curl_sys::CURL_SSLVERSION_TLSv1_1 as isize,
+    Tlsv12 = curl_sys::CURL_SSLVERSION_TLSv1_2 as isize,
+    Tlsv13 = curl_sys::CURL_SSLVERSION_TLSv1_3 as isize,
+}
+
+/// Possible return values from the `seek_function` callback.
+#[non_exhaustive]
+#[derive(Debug, Clone, Copy)]
+pub enum SeekResult {
+    /// Indicates that the seek operation was a success
+    Ok = curl_sys::CURL_SEEKFUNC_OK as isize,
+
+    /// Indicates that the seek operation failed, and the entire request should
+    /// fail as a result.
+    Fail = curl_sys::CURL_SEEKFUNC_FAIL as isize,
+
+    /// Indicates that although the seek failed libcurl should attempt to keep
+    /// working if possible (for example "seek" through reading).
+    CantSeek = curl_sys::CURL_SEEKFUNC_CANTSEEK as isize,
+}
+
+/// Possible data chunks that can be witnessed as part of the `debug_function`
+/// callback.
+#[non_exhaustive]
+#[derive(Debug, Clone, Copy)]
+pub enum InfoType {
+    /// The data is informational text.
+    Text,
+
+    /// The data is header (or header-like) data received from the peer.
+    HeaderIn,
+
+    /// The data is header (or header-like) data sent to the peer.
+    HeaderOut,
+
+    /// The data is protocol data received from the peer.
+    DataIn,
+
+    /// The data is protocol data sent to the peer.
+    DataOut,
+
+    /// The data is SSL/TLS (binary) data received from the peer.
+    SslDataIn,
+
+    /// The data is SSL/TLS (binary) data sent to the peer.
+    SslDataOut,
+}
+
+/// Possible error codes that can be returned from the `read_function` callback.
+#[non_exhaustive]
+#[derive(Debug)]
+pub enum ReadError {
+    /// Indicates that the connection should be aborted immediately
+    Abort,
+
+    /// Indicates that reading should be paused until `unpause` is called.
+    Pause,
+}
+
+/// Possible error codes that can be returned from the `write_function` callback.
+#[non_exhaustive]
+#[derive(Debug)]
+pub enum WriteError {
+    /// Indicates that reading should be paused until `unpause` is called.
+    Pause,
+}
+
+/// Options for `.netrc` parsing.
+#[derive(Debug, Clone, Copy)]
+pub enum NetRc {
+    /// Ignoring `.netrc` file and use information from url
+    ///
+    /// This option is default
+    Ignored = curl_sys::CURL_NETRC_IGNORED as isize,
+
+    /// The  use of your `~/.netrc` file is optional, and information in the URL is to be
+    /// preferred. The file will be scanned for the host and user name (to find the password only)
+    /// or for the host only, to find the first user name and password after that machine, which
+    /// ever information is not specified in the URL.
+    Optional = curl_sys::CURL_NETRC_OPTIONAL as isize,
+
+    /// This value tells the library that use of the file is required, to ignore the information in
+    /// the URL, and to search the file for the host only.
+    Required = curl_sys::CURL_NETRC_REQUIRED as isize,
+}
+
+/// Structure which stores possible authentication methods to get passed to
+/// `http_auth` and `proxy_auth`.
+#[derive(Clone)]
+pub struct Auth {
+    bits: c_long,
+}
+
+/// Structure which stores possible ssl options to pass to `ssl_options`.
+#[derive(Clone)]
+pub struct SslOpt {
+    bits: c_long,
+}
+/// Structure which stores possible post redirection options to pass to `post_redirections`.
+pub struct PostRedirections {
+    bits: c_ulong,
+}
+
+impl<H: Handler> Easy2<H> {
+    /// Creates a new "easy" handle which is the core of almost all operations
+    /// in libcurl.
+    ///
+    /// To use a handle, applications typically configure a number of options
+    /// followed by a call to `perform`. Options are preserved across calls to
+    /// `perform` and need to be reset manually (or via the `reset` method) if
+    /// this is not desired.
+    pub fn new(handler: H) -> Easy2<H> {
+        crate::init();
+        unsafe {
+            let handle = curl_sys::curl_easy_init();
+            assert!(!handle.is_null());
+            let mut ret = Easy2 {
+                inner: Box::new(Inner {
+                    handle,
+                    header_list: None,
+                    resolve_list: None,
+                    connect_to_list: None,
+                    form: None,
+                    error_buf: RefCell::new(vec![0; curl_sys::CURL_ERROR_SIZE]),
+                    handler,
+                }),
+            };
+            ret.default_configure();
+            ret
+        }
+    }
+
+    /// Re-initializes this handle to the default values.
+    ///
+    /// This puts the handle to the same state as it was in when it was just
+    /// created. This does, however, keep live connections, the session id
+    /// cache, the dns cache, and cookies.
+    pub fn reset(&mut self) {
+        unsafe {
+            curl_sys::curl_easy_reset(self.inner.handle);
+        }
+        self.default_configure();
+    }
+
+    fn default_configure(&mut self) {
+        self.setopt_ptr(
+            curl_sys::CURLOPT_ERRORBUFFER,
+            self.inner.error_buf.borrow().as_ptr() as *const _,
+        )
+        .expect("failed to set error buffer");
+        let _ = self.signal(false);
+        self.ssl_configure();
+
+        let ptr = &*self.inner as *const _ as *const _;
+
+        let cb: extern "C" fn(*mut c_char, size_t, size_t, *mut c_void) -> size_t = header_cb::<H>;
+        self.setopt_ptr(curl_sys::CURLOPT_HEADERFUNCTION, cb as *const _)
+            .expect("failed to set header callback");
+        self.setopt_ptr(curl_sys::CURLOPT_HEADERDATA, ptr)
+            .expect("failed to set header callback");
+
+        let cb: curl_sys::curl_write_callback = write_cb::<H>;
+        self.setopt_ptr(curl_sys::CURLOPT_WRITEFUNCTION, cb as *const _)
+            .expect("failed to set write callback");
+        self.setopt_ptr(curl_sys::CURLOPT_WRITEDATA, ptr)
+            .expect("failed to set write callback");
+
+        let cb: curl_sys::curl_read_callback = read_cb::<H>;
+        self.setopt_ptr(curl_sys::CURLOPT_READFUNCTION, cb as *const _)
+            .expect("failed to set read callback");
+        self.setopt_ptr(curl_sys::CURLOPT_READDATA, ptr)
+            .expect("failed to set read callback");
+
+        let cb: curl_sys::curl_seek_callback = seek_cb::<H>;
+        self.setopt_ptr(curl_sys::CURLOPT_SEEKFUNCTION, cb as *const _)
+            .expect("failed to set seek callback");
+        self.setopt_ptr(curl_sys::CURLOPT_SEEKDATA, ptr)
+            .expect("failed to set seek callback");
+
+        let cb: curl_sys::curl_progress_callback = progress_cb::<H>;
+        self.setopt_ptr(curl_sys::CURLOPT_PROGRESSFUNCTION, cb as *const _)
+            .expect("failed to set progress callback");
+        self.setopt_ptr(curl_sys::CURLOPT_PROGRESSDATA, ptr)
+            .expect("failed to set progress callback");
+
+        let cb: curl_sys::curl_debug_callback = debug_cb::<H>;
+        self.setopt_ptr(curl_sys::CURLOPT_DEBUGFUNCTION, cb as *const _)
+            .expect("failed to set debug callback");
+        self.setopt_ptr(curl_sys::CURLOPT_DEBUGDATA, ptr)
+            .expect("failed to set debug callback");
+
+        let cb: curl_sys::curl_ssl_ctx_callback = ssl_ctx_cb::<H>;
+        drop(self.setopt_ptr(curl_sys::CURLOPT_SSL_CTX_FUNCTION, cb as *const _));
+        drop(self.setopt_ptr(curl_sys::CURLOPT_SSL_CTX_DATA, ptr));
+
+        let cb: curl_sys::curl_opensocket_callback = opensocket_cb::<H>;
+        self.setopt_ptr(curl_sys::CURLOPT_OPENSOCKETFUNCTION, cb as *const _)
+            .expect("failed to set open socket callback");
+        self.setopt_ptr(curl_sys::CURLOPT_OPENSOCKETDATA, ptr)
+            .expect("failed to set open socket callback");
+    }
+
+    #[cfg(need_openssl_probe)]
+    fn ssl_configure(&mut self) {
+        use std::sync::Once;
+
+        static mut PROBE: Option<::openssl_probe::ProbeResult> = None;
+        static INIT: Once = Once::new();
+
+        // Probe for certificate stores the first time an easy handle is created,
+        // and re-use the results for subsequent handles.
+        INIT.call_once(|| unsafe {
+            PROBE = Some(::openssl_probe::probe());
+        });
+        let probe = unsafe { PROBE.as_ref().unwrap() };
+
+        if let Some(ref path) = probe.cert_file {
+            let _ = self.cainfo(path);
+        }
+        if let Some(ref path) = probe.cert_dir {
+            let _ = self.capath(path);
+        }
+    }
+
+    #[cfg(not(need_openssl_probe))]
+    fn ssl_configure(&mut self) {}
+}
+
+impl<H> Easy2<H> {
+    // =========================================================================
+    // Behavior options
+
+    /// Configures this handle to have verbose output to help debug protocol
+    /// information.
+    ///
+    /// By default output goes to stderr, but the `stderr` function on this type
+    /// can configure that. You can also use the `debug_function` method to get
+    /// all protocol data sent and received.
+    ///
+    /// By default, this option is `false`.
+    pub fn verbose(&mut self, verbose: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_VERBOSE, verbose as c_long)
+    }
+
+    /// Indicates whether header information is streamed to the output body of
+    /// this request.
+    ///
+    /// This option is only relevant for protocols which have header metadata
+    /// (like http or ftp). It's not generally possible to extract headers
+    /// from the body if using this method, that use case should be intended for
+    /// the `header_function` method.
+    ///
+    /// To set HTTP headers, use the `http_header` method.
+    ///
+    /// By default, this option is `false` and corresponds to
+    /// `CURLOPT_HEADER`.
+    pub fn show_header(&mut self, show: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_HEADER, show as c_long)
+    }
+
+    /// Indicates whether a progress meter will be shown for requests done with
+    /// this handle.
+    ///
+    /// This will also prevent the `progress_function` from being called.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_NOPROGRESS`.
+    pub fn progress(&mut self, progress: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_NOPROGRESS, (!progress) as c_long)
+    }
+
+    /// Inform libcurl whether or not it should install signal handlers or
+    /// attempt to use signals to perform library functions.
+    ///
+    /// If this option is disabled then timeouts during name resolution will not
+    /// work unless libcurl is built against c-ares. Note that enabling this
+    /// option, however, may not cause libcurl to work with multiple threads.
+    ///
+    /// By default this option is `false` and corresponds to `CURLOPT_NOSIGNAL`.
+    /// Note that this default is **different than libcurl** as it is intended
+    /// that this library is threadsafe by default. See the [libcurl docs] for
+    /// some more information.
+    ///
+    /// [libcurl docs]: https://curl.haxx.se/libcurl/c/threadsafe.html
+    pub fn signal(&mut self, signal: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_NOSIGNAL, (!signal) as c_long)
+    }
+
+    /// Indicates whether multiple files will be transferred based on the file
+    /// name pattern.
+    ///
+    /// The last part of a filename uses fnmatch-like pattern matching.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_WILDCARDMATCH`.
+    pub fn wildcard_match(&mut self, m: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_WILDCARDMATCH, m as c_long)
+    }
+
+    /// Provides the Unix domain socket which this handle will work with.
+    ///
+    /// The string provided must be a path to a Unix domain socket encoded with
+    /// the format:
+    ///
+    /// ```text
+    /// /path/file.sock
+    /// ```
+    ///
+    /// By default this option is not set and corresponds to
+    /// [`CURLOPT_UNIX_SOCKET_PATH`](https://curl.haxx.se/libcurl/c/CURLOPT_UNIX_SOCKET_PATH.html).
+    pub fn unix_socket(&mut self, unix_domain_socket: &str) -> Result<(), Error> {
+        let socket = CString::new(unix_domain_socket)?;
+        self.setopt_str(curl_sys::CURLOPT_UNIX_SOCKET_PATH, &socket)
+    }
+
+    /// Provides the Unix domain socket which this handle will work with.
+    ///
+    /// The string provided must be a path to a Unix domain socket encoded with
+    /// the format:
+    ///
+    /// ```text
+    /// /path/file.sock
+    /// ```
+    ///
+    /// This function is an alternative to [`Easy2::unix_socket`] that supports
+    /// non-UTF-8 paths and also supports disabling Unix sockets by setting the
+    /// option to `None`.
+    ///
+    /// By default this option is not set and corresponds to
+    /// [`CURLOPT_UNIX_SOCKET_PATH`](https://curl.haxx.se/libcurl/c/CURLOPT_UNIX_SOCKET_PATH.html).
+    pub fn unix_socket_path<P: AsRef<Path>>(&mut self, path: Option<P>) -> Result<(), Error> {
+        if let Some(path) = path {
+            self.setopt_path(curl_sys::CURLOPT_UNIX_SOCKET_PATH, path.as_ref())
+        } else {
+            self.setopt_ptr(curl_sys::CURLOPT_UNIX_SOCKET_PATH, 0 as _)
+        }
+    }
+
+    /// Provides the ABSTRACT UNIX SOCKET which this handle will work with.
+    ///
+    /// This function is an alternative to [`Easy2::unix_socket`] and [`Easy2::unix_socket_path`] that supports
+    /// ABSTRACT_UNIX_SOCKET(`man 7 unix` on Linux) address.
+    ///
+    /// By default this option is not set and corresponds to
+    /// [`CURLOPT_ABSTRACT_UNIX_SOCKET`](https://curl.haxx.se/libcurl/c/CURLOPT_ABSTRACT_UNIX_SOCKET.html).
+    ///
+    /// NOTE: this API can only be used on Linux OS.
+    #[cfg(target_os = "linux")]
+    pub fn abstract_unix_socket(&mut self, addr: &[u8]) -> Result<(), Error> {
+        let addr = CString::new(addr)?;
+        self.setopt_str(curl_sys::CURLOPT_ABSTRACT_UNIX_SOCKET, &addr)
+    }
+
+    // =========================================================================
+    // Internal accessors
+
+    /// Acquires a reference to the underlying handler for events.
+    pub fn get_ref(&self) -> &H {
+        &self.inner.handler
+    }
+
+    /// Acquires a reference to the underlying handler for events.
+    pub fn get_mut(&mut self) -> &mut H {
+        &mut self.inner.handler
+    }
+
+    // =========================================================================
+    // Error options
+
+    // TODO: error buffer and stderr
+
+    /// Indicates whether this library will fail on HTTP response codes >= 400.
+    ///
+    /// This method is not fail-safe especially when authentication is involved.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_FAILONERROR`.
+    pub fn fail_on_error(&mut self, fail: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_FAILONERROR, fail as c_long)
+    }
+
+    // =========================================================================
+    // Network options
+
+    /// Provides the URL which this handle will work with.
+    ///
+    /// The string provided must be URL-encoded with the format:
+    ///
+    /// ```text
+    /// scheme://host:port/path
+    /// ```
+    ///
+    /// The syntax is not validated as part of this function and that is
+    /// deferred until later.
+    ///
+    /// By default this option is not set and `perform` will not work until it
+    /// is set. This option corresponds to `CURLOPT_URL`.
+    pub fn url(&mut self, url: &str) -> Result<(), Error> {
+        let url = CString::new(url)?;
+        self.setopt_str(curl_sys::CURLOPT_URL, &url)
+    }
+
+    /// Configures the port number to connect to, instead of the one specified
+    /// in the URL or the default of the protocol.
+    pub fn port(&mut self, port: u16) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_PORT, port as c_long)
+    }
+
+    /// Connect to a specific host and port.
+    ///
+    /// Each single string should be written using the format
+    /// `HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT` where `HOST` is the host of
+    /// the request, `PORT` is the port of the request, `CONNECT-TO-HOST` is the
+    /// host name to connect to, and `CONNECT-TO-PORT` is the port to connect
+    /// to.
+    ///
+    /// The first string that matches the request's host and port is used.
+    ///
+    /// By default, this option is empty and corresponds to
+    /// [`CURLOPT_CONNECT_TO`](https://curl.haxx.se/libcurl/c/CURLOPT_CONNECT_TO.html).
+    pub fn connect_to(&mut self, list: List) -> Result<(), Error> {
+        let ptr = list::raw(&list);
+        self.inner.connect_to_list = Some(list);
+        self.setopt_ptr(curl_sys::CURLOPT_CONNECT_TO, ptr as *const _)
+    }
+
+    /// Indicates whether sequences of `/../` and `/./` will be squashed or not.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_PATH_AS_IS`.
+    pub fn path_as_is(&mut self, as_is: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_PATH_AS_IS, as_is as c_long)
+    }
+
+    /// Provide the URL of a proxy to use.
+    ///
+    /// By default this option is not set and corresponds to `CURLOPT_PROXY`.
+    pub fn proxy(&mut self, url: &str) -> Result<(), Error> {
+        let url = CString::new(url)?;
+        self.setopt_str(curl_sys::CURLOPT_PROXY, &url)
+    }
+
+    /// Provide port number the proxy is listening on.
+    ///
+    /// By default this option is not set (the default port for the proxy
+    /// protocol is used) and corresponds to `CURLOPT_PROXYPORT`.
+    pub fn proxy_port(&mut self, port: u16) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_PROXYPORT, port as c_long)
+    }
+
+    /// Set CA certificate to verify peer against for proxy.
+    ///
+    /// By default this value is not set and corresponds to
+    /// `CURLOPT_PROXY_CAINFO`.
+    pub fn proxy_cainfo(&mut self, cainfo: &str) -> Result<(), Error> {
+        let cainfo = CString::new(cainfo)?;
+        self.setopt_str(curl_sys::CURLOPT_PROXY_CAINFO, &cainfo)
+    }
+
+    /// Specify a directory holding CA certificates for proxy.
+    ///
+    /// The specified directory should hold multiple CA certificates to verify
+    /// the HTTPS proxy with. If libcurl is built against OpenSSL, the
+    /// certificate directory must be prepared using the OpenSSL `c_rehash`
+    /// utility.
+    ///
+    /// By default this value is not set and corresponds to
+    /// `CURLOPT_PROXY_CAPATH`.
+    pub fn proxy_capath<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.setopt_path(curl_sys::CURLOPT_PROXY_CAPATH, path.as_ref())
+    }
+
+    /// Set client certificate for proxy.
+    ///
+    /// By default this value is not set and corresponds to
+    /// `CURLOPT_PROXY_SSLCERT`.
+    pub fn proxy_sslcert(&mut self, sslcert: &str) -> Result<(), Error> {
+        let sslcert = CString::new(sslcert)?;
+        self.setopt_str(curl_sys::CURLOPT_PROXY_SSLCERT, &sslcert)
+    }
+
+    /// Specify type of the client SSL certificate for HTTPS proxy.
+    ///
+    /// The string should be the format of your certificate. Supported formats
+    /// are "PEM" and "DER", except with Secure Transport. OpenSSL (versions
+    /// 0.9.3 and later) and Secure Transport (on iOS 5 or later, or OS X 10.7
+    /// or later) also support "P12" for PKCS#12-encoded files.
+    ///
+    /// By default this option is "PEM" and corresponds to
+    /// `CURLOPT_PROXY_SSLCERTTYPE`.
+    pub fn proxy_sslcert_type(&mut self, kind: &str) -> Result<(), Error> {
+        let kind = CString::new(kind)?;
+        self.setopt_str(curl_sys::CURLOPT_PROXY_SSLCERTTYPE, &kind)
+    }
+
+    /// Set the client certificate for the proxy using an in-memory blob.
+    ///
+    /// The specified byte buffer should contain the binary content of the
+    /// certificate, which will be copied into the handle.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_PROXY_SSLCERT_BLOB`.
+    pub fn proxy_sslcert_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.setopt_blob(curl_sys::CURLOPT_PROXY_SSLCERT_BLOB, blob)
+    }
+
+    /// Set private key for HTTPS proxy.
+    ///
+    /// By default this value is not set and corresponds to
+    /// `CURLOPT_PROXY_SSLKEY`.
+    pub fn proxy_sslkey(&mut self, sslkey: &str) -> Result<(), Error> {
+        let sslkey = CString::new(sslkey)?;
+        self.setopt_str(curl_sys::CURLOPT_PROXY_SSLKEY, &sslkey)
+    }
+
+    /// Set type of the private key file for HTTPS proxy.
+    ///
+    /// The string should be the format of your private key. Supported formats
+    /// are "PEM", "DER" and "ENG".
+    ///
+    /// The format "ENG" enables you to load the private key from a crypto
+    /// engine. In this case `ssl_key` is used as an identifier passed to
+    /// the engine. You have to set the crypto engine with `ssl_engine`.
+    /// "DER" format key file currently does not work because of a bug in
+    /// OpenSSL.
+    ///
+    /// By default this option is "PEM" and corresponds to
+    /// `CURLOPT_PROXY_SSLKEYTYPE`.
+    pub fn proxy_sslkey_type(&mut self, kind: &str) -> Result<(), Error> {
+        let kind = CString::new(kind)?;
+        self.setopt_str(curl_sys::CURLOPT_PROXY_SSLKEYTYPE, &kind)
+    }
+
+    /// Set the private key for the proxy using an in-memory blob.
+    ///
+    /// The specified byte buffer should contain the binary content of the
+    /// private key, which will be copied into the handle.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_PROXY_SSLKEY_BLOB`.
+    pub fn proxy_sslkey_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.setopt_blob(curl_sys::CURLOPT_PROXY_SSLKEY_BLOB, blob)
+    }
+
+    /// Set passphrase to private key for HTTPS proxy.
+    ///
+    /// This will be used as the password required to use the `ssl_key`.
+    /// You never needed a pass phrase to load a certificate but you need one to
+    /// load your private key.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_PROXY_KEYPASSWD`.
+    pub fn proxy_key_password(&mut self, password: &str) -> Result<(), Error> {
+        let password = CString::new(password)?;
+        self.setopt_str(curl_sys::CURLOPT_PROXY_KEYPASSWD, &password)
+    }
+
+    /// Indicates the type of proxy being used.
+    ///
+    /// By default this option is `ProxyType::Http` and corresponds to
+    /// `CURLOPT_PROXYTYPE`.
+    pub fn proxy_type(&mut self, kind: ProxyType) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_PROXYTYPE, kind as c_long)
+    }
+
+    /// Provide a list of hosts that should not be proxied to.
+    ///
+    /// This string is a comma-separated list of hosts which should not use the
+    /// proxy specified for connections. A single `*` character is also accepted
+    /// as a wildcard for all hosts.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_NOPROXY`.
+    pub fn noproxy(&mut self, skip: &str) -> Result<(), Error> {
+        let skip = CString::new(skip)?;
+        self.setopt_str(curl_sys::CURLOPT_NOPROXY, &skip)
+    }
+
+    /// Inform curl whether it should tunnel all operations through the proxy.
+    ///
+    /// This essentially means that a `CONNECT` is sent to the proxy for all
+    /// outbound requests.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_HTTPPROXYTUNNEL`.
+    pub fn http_proxy_tunnel(&mut self, tunnel: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_HTTPPROXYTUNNEL, tunnel as c_long)
+    }
+
+    /// Tell curl which interface to bind to for an outgoing network interface.
+    ///
+    /// The interface name, IP address, or host name can be specified here.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_INTERFACE`.
+    pub fn interface(&mut self, interface: &str) -> Result<(), Error> {
+        let s = CString::new(interface)?;
+        self.setopt_str(curl_sys::CURLOPT_INTERFACE, &s)
+    }
+
+    /// Indicate which port should be bound to locally for this connection.
+    ///
+    /// By default this option is 0 (any port) and corresponds to
+    /// `CURLOPT_LOCALPORT`.
+    pub fn set_local_port(&mut self, port: u16) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_LOCALPORT, port as c_long)
+    }
+
+    /// Indicates the number of attempts libcurl will perform to find a working
+    /// port number.
+    ///
+    /// By default this option is 1 and corresponds to
+    /// `CURLOPT_LOCALPORTRANGE`.
+    pub fn local_port_range(&mut self, range: u16) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_LOCALPORTRANGE, range as c_long)
+    }
+
+    /// Sets the DNS servers that wil be used.
+    ///
+    /// Provide a comma separated list, for example: `8.8.8.8,8.8.4.4`.
+    ///
+    /// By default this option is not set and the OS's DNS resolver is used.
+    /// This option can only be used if libcurl is linked against
+    /// [c-ares](https://c-ares.haxx.se), otherwise setting it will return
+    /// an error.
+    pub fn dns_servers(&mut self, servers: &str) -> Result<(), Error> {
+        let s = CString::new(servers)?;
+        self.setopt_str(curl_sys::CURLOPT_DNS_SERVERS, &s)
+    }
+
+    /// Sets the timeout of how long name resolves will be kept in memory.
+    ///
+    /// This is distinct from DNS TTL options and is entirely speculative.
+    ///
+    /// By default this option is 60s and corresponds to
+    /// `CURLOPT_DNS_CACHE_TIMEOUT`.
+    pub fn dns_cache_timeout(&mut self, dur: Duration) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_DNS_CACHE_TIMEOUT, dur.as_secs() as c_long)
+    }
+
+    /// Provide the DNS-over-HTTPS URL.
+    ///
+    /// The parameter must be URL-encoded in the following format:
+    /// `https://host:port/path`. It **must** specify a HTTPS URL.
+    ///
+    /// libcurl does not validate the syntax or use this variable until the
+    /// transfer is issued. Even if you set a crazy value here, this method will
+    /// still return [`Ok`].
+    ///
+    /// curl sends `POST` requests to the given DNS-over-HTTPS URL.
+    ///
+    /// To find the DoH server itself, which might be specified using a name,
+    /// libcurl will use the default name lookup function. You can bootstrap
+    /// that by providing the address for the DoH server with
+    /// [`Easy2::resolve`].
+    ///
+    /// Disable DoH use again by setting this option to [`None`].
+    ///
+    /// By default this option is not set and corresponds to `CURLOPT_DOH_URL`.
+    pub fn doh_url(&mut self, url: Option<&str>) -> Result<(), Error> {
+        if let Some(url) = url {
+            let url = CString::new(url)?;
+            self.setopt_str(curl_sys::CURLOPT_DOH_URL, &url)
+        } else {
+            self.setopt_ptr(curl_sys::CURLOPT_DOH_URL, ptr::null())
+        }
+    }
+
+    /// This option tells curl to verify the authenticity of the DoH
+    /// (DNS-over-HTTPS) server's certificate. A value of `true` means curl
+    /// verifies; `false` means it does not.
+    ///
+    /// This option is the DoH equivalent of [`Easy2::ssl_verify_peer`] and only
+    /// affects requests to the DoH server.
+    ///
+    /// When negotiating a TLS or SSL connection, the server sends a certificate
+    /// indicating its identity. Curl verifies whether the certificate is
+    /// authentic, i.e. that you can trust that the server is who the
+    /// certificate says it is. This trust is based on a chain of digital
+    /// signatures, rooted in certification authority (CA) certificates you
+    /// supply. curl uses a default bundle of CA certificates (the path for that
+    /// is determined at build time) and you can specify alternate certificates
+    /// with the [`Easy2::cainfo`] option or the [`Easy2::capath`] option.
+    ///
+    /// When `doh_ssl_verify_peer` is enabled, and the verification fails to
+    /// prove that the certificate is authentic, the connection fails. When the
+    /// option is zero, the peer certificate verification succeeds regardless.
+    ///
+    /// Authenticating the certificate is not enough to be sure about the
+    /// server. You typically also want to ensure that the server is the server
+    /// you mean to be talking to. Use [`Easy2::doh_ssl_verify_host`] for that.
+    /// The check that the host name in the certificate is valid for the host
+    /// name you are connecting to is done independently of the
+    /// `doh_ssl_verify_peer` option.
+    ///
+    /// **WARNING:** disabling verification of the certificate allows bad guys
+    /// to man-in-the-middle the communication without you knowing it. Disabling
+    /// verification makes the communication insecure. Just having encryption on
+    /// a transfer is not enough as you cannot be sure that you are
+    /// communicating with the correct end-point.
+    ///
+    /// By default this option is set to `true` and corresponds to
+    /// `CURLOPT_DOH_SSL_VERIFYPEER`.
+    pub fn doh_ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_DOH_SSL_VERIFYPEER, verify.into())
+    }
+
+    /// Tells curl to verify the DoH (DNS-over-HTTPS) server's certificate name
+    /// fields against the host name.
+    ///
+    /// This option is the DoH equivalent of [`Easy2::ssl_verify_host`] and only
+    /// affects requests to the DoH server.
+    ///
+    /// When `doh_ssl_verify_host` is `true`, the SSL certificate provided by
+    /// the DoH server must indicate that the server name is the same as the
+    /// server name to which you meant to connect to, or the connection fails.
+    ///
+    /// Curl considers the DoH server the intended one when the Common Name
+    /// field or a Subject Alternate Name field in the certificate matches the
+    /// host name in the DoH URL to which you told Curl to connect.
+    ///
+    /// When the verify value is set to `false`, the connection succeeds
+    /// regardless of the names used in the certificate. Use that ability with
+    /// caution!
+    ///
+    /// See also [`Easy2::doh_ssl_verify_peer`] to verify the digital signature
+    /// of the DoH server certificate. If libcurl is built against NSS and
+    /// [`Easy2::doh_ssl_verify_peer`] is `false`, `doh_ssl_verify_host` is also
+    /// set to `false` and cannot be overridden.
+    ///
+    /// By default this option is set to `true` and corresponds to
+    /// `CURLOPT_DOH_SSL_VERIFYHOST`.
+    pub fn doh_ssl_verify_host(&mut self, verify: bool) -> Result<(), Error> {
+        self.setopt_long(
+            curl_sys::CURLOPT_DOH_SSL_VERIFYHOST,
+            if verify { 2 } else { 0 },
+        )
+    }
+
+    /// Pass a long as parameter set to 1 to enable or 0 to disable.
+    ///
+    /// This option determines whether libcurl verifies the status of the DoH
+    /// (DNS-over-HTTPS) server cert using the "Certificate Status Request" TLS
+    /// extension (aka. OCSP stapling).
+    ///
+    /// This option is the DoH equivalent of CURLOPT_SSL_VERIFYSTATUS and only
+    /// affects requests to the DoH server.
+    ///
+    /// Note that if this option is enabled but the server does not support the
+    /// TLS extension, the verification will fail.
+    ///
+    /// By default this option is set to `false` and corresponds to
+    /// `CURLOPT_DOH_SSL_VERIFYSTATUS`.
+    pub fn doh_ssl_verify_status(&mut self, verify: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_DOH_SSL_VERIFYSTATUS, verify.into())
+    }
+
+    /// Specify the preferred receive buffer size, in bytes.
+    ///
+    /// This is treated as a request, not an order, and the main point of this
+    /// is that the write callback may get called more often with smaller
+    /// chunks.
+    ///
+    /// By default this option is the maximum write size and corresopnds to
+    /// `CURLOPT_BUFFERSIZE`.
+    pub fn buffer_size(&mut self, size: usize) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_BUFFERSIZE, size as c_long)
+    }
+
+    /// Specify the preferred send buffer size, in bytes.
+    ///
+    /// This is treated as a request, not an order, and the main point of this
+    /// is that the read callback may get called more often with smaller
+    /// chunks.
+    ///
+    /// The upload buffer size is by default 64 kilobytes.
+    pub fn upload_buffer_size(&mut self, size: usize) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_UPLOAD_BUFFERSIZE, size as c_long)
+    }
+
+    // /// Enable or disable TCP Fast Open
+    // ///
+    // /// By default this options defaults to `false` and corresponds to
+    // /// `CURLOPT_TCP_FASTOPEN`
+    // pub fn fast_open(&mut self, enable: bool) -> Result<(), Error> {
+    // }
+
+    /// Configures whether the TCP_NODELAY option is set, or Nagle's algorithm
+    /// is disabled.
+    ///
+    /// The purpose of Nagle's algorithm is to minimize the number of small
+    /// packet's on the network, and disabling this may be less efficient in
+    /// some situations.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_TCP_NODELAY`.
+    pub fn tcp_nodelay(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_TCP_NODELAY, enable as c_long)
+    }
+
+    /// Configures whether TCP keepalive probes will be sent.
+    ///
+    /// The delay and frequency of these probes is controlled by `tcp_keepidle`
+    /// and `tcp_keepintvl`.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_TCP_KEEPALIVE`.
+    pub fn tcp_keepalive(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_TCP_KEEPALIVE, enable as c_long)
+    }
+
+    /// Configures the TCP keepalive idle time wait.
+    ///
+    /// This is the delay, after which the connection is idle, keepalive probes
+    /// will be sent. Not all operating systems support this.
+    ///
+    /// By default this corresponds to `CURLOPT_TCP_KEEPIDLE`.
+    pub fn tcp_keepidle(&mut self, amt: Duration) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_TCP_KEEPIDLE, amt.as_secs() as c_long)
+    }
+
+    /// Configures the delay between keepalive probes.
+    ///
+    /// By default this corresponds to `CURLOPT_TCP_KEEPINTVL`.
+    pub fn tcp_keepintvl(&mut self, amt: Duration) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_TCP_KEEPINTVL, amt.as_secs() as c_long)
+    }
+
+    /// Configures the scope for local IPv6 addresses.
+    ///
+    /// Sets the scope_id value to use when connecting to IPv6 or link-local
+    /// addresses.
+    ///
+    /// By default this value is 0 and corresponds to `CURLOPT_ADDRESS_SCOPE`
+    pub fn address_scope(&mut self, scope: u32) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_ADDRESS_SCOPE, scope as c_long)
+    }
+
+    // =========================================================================
+    // Names and passwords
+
+    /// Configures the username to pass as authentication for this connection.
+    ///
+    /// By default this value is not set and corresponds to `CURLOPT_USERNAME`.
+    pub fn username(&mut self, user: &str) -> Result<(), Error> {
+        let user = CString::new(user)?;
+        self.setopt_str(curl_sys::CURLOPT_USERNAME, &user)
+    }
+
+    /// Configures the password to pass as authentication for this connection.
+    ///
+    /// By default this value is not set and corresponds to `CURLOPT_PASSWORD`.
+    pub fn password(&mut self, pass: &str) -> Result<(), Error> {
+        let pass = CString::new(pass)?;
+        self.setopt_str(curl_sys::CURLOPT_PASSWORD, &pass)
+    }
+
+    /// Set HTTP server authentication methods to try
+    ///
+    /// If more than one method is set, libcurl will first query the site to see
+    /// which authentication methods it supports and then pick the best one you
+    /// allow it to use. For some methods, this will induce an extra network
+    /// round-trip. Set the actual name and password with the `password` and
+    /// `username` methods.
+    ///
+    /// For authentication with a proxy, see `proxy_auth`.
+    ///
+    /// By default this value is basic and corresponds to `CURLOPT_HTTPAUTH`.
+    pub fn http_auth(&mut self, auth: &Auth) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_HTTPAUTH, auth.bits)
+    }
+
+    /// Provides AWS V4 signature authentication on HTTP(S) header.
+    ///
+    /// `param` is used to create outgoing authentication headers.
+    /// Its format is `provider1[:provider2[:region[:service]]]`.
+    /// `provider1,\ provider2"` are used for generating auth parameters
+    /// such as "Algorithm", "date", "request type" and "signed headers".
+    /// `region` is the geographic area of a resources collection. It is
+    /// extracted from the host name specified in the URL if omitted.
+    /// `service` is a function provided by a cloud. It is extracted
+    /// from the host name specified in the URL if omitted.
+    ///
+    /// Example with "Test:Try", when curl will do the algorithm, it will
+    /// generate "TEST-HMAC-SHA256" for "Algorithm", "x-try-date" and
+    /// "X-Try-Date" for "date", "test4_request" for "request type", and
+    /// "SignedHeaders=content-type;host;x-try-date" for "signed headers".
+    /// If you use just "test", instead of "test:try", test will be use
+    /// for every strings generated.
+    ///
+    /// This is a special auth type that can't be combined with the others.
+    /// It will override the other auth types you might have set.
+    ///
+    /// By default this is not set and corresponds to `CURLOPT_AWS_SIGV4`.
+    pub fn aws_sigv4(&mut self, param: &str) -> Result<(), Error> {
+        let param = CString::new(param)?;
+        self.setopt_str(curl_sys::CURLOPT_AWS_SIGV4, &param)
+    }
+
+    /// Configures the proxy username to pass as authentication for this
+    /// connection.
+    ///
+    /// By default this value is not set and corresponds to
+    /// `CURLOPT_PROXYUSERNAME`.
+    pub fn proxy_username(&mut self, user: &str) -> Result<(), Error> {
+        let user = CString::new(user)?;
+        self.setopt_str(curl_sys::CURLOPT_PROXYUSERNAME, &user)
+    }
+
+    /// Configures the proxy password to pass as authentication for this
+    /// connection.
+    ///
+    /// By default this value is not set and corresponds to
+    /// `CURLOPT_PROXYPASSWORD`.
+    pub fn proxy_password(&mut self, pass: &str) -> Result<(), Error> {
+        let pass = CString::new(pass)?;
+        self.setopt_str(curl_sys::CURLOPT_PROXYPASSWORD, &pass)
+    }
+
+    /// Set HTTP proxy authentication methods to try
+    ///
+    /// If more than one method is set, libcurl will first query the site to see
+    /// which authentication methods it supports and then pick the best one you
+    /// allow it to use. For some methods, this will induce an extra network
+    /// round-trip. Set the actual name and password with the `proxy_password`
+    /// and `proxy_username` methods.
+    ///
+    /// By default this value is basic and corresponds to `CURLOPT_PROXYAUTH`.
+    pub fn proxy_auth(&mut self, auth: &Auth) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_PROXYAUTH, auth.bits)
+    }
+
+    /// Enable .netrc parsing
+    ///
+    /// By default the .netrc file is ignored and corresponds to `CURL_NETRC_IGNORED`.
+    pub fn netrc(&mut self, netrc: NetRc) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_NETRC, netrc as c_long)
+    }
+
+    // =========================================================================
+    // HTTP Options
+
+    /// Indicates whether the referer header is automatically updated
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_AUTOREFERER`.
+    pub fn autoreferer(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_AUTOREFERER, enable as c_long)
+    }
+
+    /// Enables automatic decompression of HTTP downloads.
+    ///
+    /// Sets the contents of the Accept-Encoding header sent in an HTTP request.
+    /// This enables decoding of a response with Content-Encoding.
+    ///
+    /// Currently supported encoding are `identity`, `zlib`, and `gzip`. A
+    /// zero-length string passed in will send all accepted encodings.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_ACCEPT_ENCODING`.
+    pub fn accept_encoding(&mut self, encoding: &str) -> Result<(), Error> {
+        let encoding = CString::new(encoding)?;
+        self.setopt_str(curl_sys::CURLOPT_ACCEPT_ENCODING, &encoding)
+    }
+
+    /// Request the HTTP Transfer Encoding.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_TRANSFER_ENCODING`.
+    pub fn transfer_encoding(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_TRANSFER_ENCODING, enable as c_long)
+    }
+
+    /// Follow HTTP 3xx redirects.
+    ///
+    /// Indicates whether any `Location` headers in the response should get
+    /// followed.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_FOLLOWLOCATION`.
+    pub fn follow_location(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_FOLLOWLOCATION, enable as c_long)
+    }
+
+    /// Send credentials to hosts other than the first as well.
+    ///
+    /// Sends username/password credentials even when the host changes as part
+    /// of a redirect.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_UNRESTRICTED_AUTH`.
+    pub fn unrestricted_auth(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_UNRESTRICTED_AUTH, enable as c_long)
+    }
+
+    /// Set the maximum number of redirects allowed.
+    ///
+    /// A value of 0 will refuse any redirect.
+    ///
+    /// By default this option is `-1` (unlimited) and corresponds to
+    /// `CURLOPT_MAXREDIRS`.
+    pub fn max_redirections(&mut self, max: u32) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_MAXREDIRS, max as c_long)
+    }
+
+    /// Set the policy for handling redirects to POST requests.
+    ///
+    /// By default a POST is changed to a GET when following a redirect. Setting any
+    /// of the `PostRedirections` flags will preserve the POST method for the
+    /// selected response codes.
+    pub fn post_redirections(&mut self, redirects: &PostRedirections) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_POSTREDIR, redirects.bits as c_long)
+    }
+
+    /// Make an HTTP PUT request.
+    ///
+    /// By default this option is `false` and corresponds to `CURLOPT_PUT`.
+    pub fn put(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_PUT, enable as c_long)
+    }
+
+    /// Make an HTTP POST request.
+    ///
+    /// This will also make the library use the
+    /// `Content-Type: application/x-www-form-urlencoded` header.
+    ///
+    /// POST data can be specified through `post_fields` or by specifying a read
+    /// function.
+    ///
+    /// By default this option is `false` and corresponds to `CURLOPT_POST`.
+    pub fn post(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_POST, enable as c_long)
+    }
+
+    /// Configures the data that will be uploaded as part of a POST.
+    ///
+    /// Note that the data is copied into this handle and if that's not desired
+    /// then the read callbacks can be used instead.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_COPYPOSTFIELDS`.
+    pub fn post_fields_copy(&mut self, data: &[u8]) -> Result<(), Error> {
+        // Set the length before the pointer so libcurl knows how much to read
+        self.post_field_size(data.len() as u64)?;
+        self.setopt_ptr(curl_sys::CURLOPT_COPYPOSTFIELDS, data.as_ptr() as *const _)
+    }
+
+    /// Configures the size of data that's going to be uploaded as part of a
+    /// POST operation.
+    ///
+    /// This is called automatically as part of `post_fields` and should only
+    /// be called if data is being provided in a read callback (and even then
+    /// it's optional).
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_POSTFIELDSIZE_LARGE`.
+    pub fn post_field_size(&mut self, size: u64) -> Result<(), Error> {
+        // Clear anything previous to ensure we don't read past a buffer
+        self.setopt_ptr(curl_sys::CURLOPT_POSTFIELDS, ptr::null())?;
+        self.setopt_off_t(
+            curl_sys::CURLOPT_POSTFIELDSIZE_LARGE,
+            size as curl_sys::curl_off_t,
+        )
+    }
+
+    /// Tells libcurl you want a multipart/formdata HTTP POST to be made and you
+    /// instruct what data to pass on to the server in the `form` argument.
+    ///
+    /// By default this option is set to null and corresponds to
+    /// `CURLOPT_HTTPPOST`.
+    pub fn httppost(&mut self, form: Form) -> Result<(), Error> {
+        self.setopt_ptr(curl_sys::CURLOPT_HTTPPOST, form::raw(&form) as *const _)?;
+        self.inner.form = Some(form);
+        Ok(())
+    }
+
+    /// Sets the HTTP referer header
+    ///
+    /// By default this option is not set and corresponds to `CURLOPT_REFERER`.
+    pub fn referer(&mut self, referer: &str) -> Result<(), Error> {
+        let referer = CString::new(referer)?;
+        self.setopt_str(curl_sys::CURLOPT_REFERER, &referer)
+    }
+
+    /// Sets the HTTP user-agent header
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_USERAGENT`.
+    pub fn useragent(&mut self, useragent: &str) -> Result<(), Error> {
+        let useragent = CString::new(useragent)?;
+        self.setopt_str(curl_sys::CURLOPT_USERAGENT, &useragent)
+    }
+
+    /// Add some headers to this HTTP request.
+    ///
+    /// If you add a header that is otherwise used internally, the value here
+    /// takes precedence. If a header is added with no content (like `Accept:`)
+    /// the internally the header will get disabled. To add a header with no
+    /// content, use the form `MyHeader;` (not the trailing semicolon).
+    ///
+    /// Headers must not be CRLF terminated. Many replaced headers have common
+    /// shortcuts which should be prefered.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_HTTPHEADER`
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use curl::easy::{Easy, List};
+    ///
+    /// let mut list = List::new();
+    /// list.append("Foo: bar").unwrap();
+    /// list.append("Bar: baz").unwrap();
+    ///
+    /// let mut handle = Easy::new();
+    /// handle.url("https://www.rust-lang.org/").unwrap();
+    /// handle.http_headers(list).unwrap();
+    /// handle.perform().unwrap();
+    /// ```
+    pub fn http_headers(&mut self, list: List) -> Result<(), Error> {
+        let ptr = list::raw(&list);
+        self.inner.header_list = Some(list);
+        self.setopt_ptr(curl_sys::CURLOPT_HTTPHEADER, ptr as *const _)
+    }
+
+    // /// Add some headers to send to the HTTP proxy.
+    // ///
+    // /// This function is essentially the same as `http_headers`.
+    // ///
+    // /// By default this option is not set and corresponds to
+    // /// `CURLOPT_PROXYHEADER`
+    // pub fn proxy_headers(&mut self, list: &'a List) -> Result<(), Error> {
+    //     self.setopt_ptr(curl_sys::CURLOPT_PROXYHEADER, list.raw as *const _)
+    // }
+
+    /// Set the contents of the HTTP Cookie header.
+    ///
+    /// Pass a string of the form `name=contents` for one cookie value or
+    /// `name1=val1; name2=val2` for multiple values.
+    ///
+    /// Using this option multiple times will only make the latest string
+    /// override the previous ones. This option will not enable the cookie
+    /// engine, use `cookie_file` or `cookie_jar` to do that.
+    ///
+    /// By default this option is not set and corresponds to `CURLOPT_COOKIE`.
+    pub fn cookie(&mut self, cookie: &str) -> Result<(), Error> {
+        let cookie = CString::new(cookie)?;
+        self.setopt_str(curl_sys::CURLOPT_COOKIE, &cookie)
+    }
+
+    /// Set the file name to read cookies from.
+    ///
+    /// The cookie data can be in either the old Netscape / Mozilla cookie data
+    /// format or just regular HTTP headers (Set-Cookie style) dumped to a file.
+    ///
+    /// This also enables the cookie engine, making libcurl parse and send
+    /// cookies on subsequent requests with this handle.
+    ///
+    /// Given an empty or non-existing file or by passing the empty string ("")
+    /// to this option, you can enable the cookie engine without reading any
+    /// initial cookies.
+    ///
+    /// If you use this option multiple times, you just add more files to read.
+    /// Subsequent files will add more cookies.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_COOKIEFILE`.
+    pub fn cookie_file<P: AsRef<Path>>(&mut self, file: P) -> Result<(), Error> {
+        self.setopt_path(curl_sys::CURLOPT_COOKIEFILE, file.as_ref())
+    }
+
+    /// Set the file name to store cookies to.
+    ///
+    /// This will make libcurl write all internally known cookies to the file
+    /// when this handle is dropped. If no cookies are known, no file will be
+    /// created. Specify "-" as filename to instead have the cookies written to
+    /// stdout. Using this option also enables cookies for this session, so if
+    /// you for example follow a location it will make matching cookies get sent
+    /// accordingly.
+    ///
+    /// Note that libcurl doesn't read any cookies from the cookie jar. If you
+    /// want to read cookies from a file, use `cookie_file`.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_COOKIEJAR`.
+    pub fn cookie_jar<P: AsRef<Path>>(&mut self, file: P) -> Result<(), Error> {
+        self.setopt_path(curl_sys::CURLOPT_COOKIEJAR, file.as_ref())
+    }
+
+    /// Start a new cookie session
+    ///
+    /// Marks this as a new cookie "session". It will force libcurl to ignore
+    /// all cookies it is about to load that are "session cookies" from the
+    /// previous session. By default, libcurl always stores and loads all
+    /// cookies, independent if they are session cookies or not. Session cookies
+    /// are cookies without expiry date and they are meant to be alive and
+    /// existing for this "session" only.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_COOKIESESSION`.
+    pub fn cookie_session(&mut self, session: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_COOKIESESSION, session as c_long)
+    }
+
+    /// Add to or manipulate cookies held in memory.
+    ///
+    /// Such a cookie can be either a single line in Netscape / Mozilla format
+    /// or just regular HTTP-style header (Set-Cookie: ...) format. This will
+    /// also enable the cookie engine. This adds that single cookie to the
+    /// internal cookie store.
+    ///
+    /// Exercise caution if you are using this option and multiple transfers may
+    /// occur. If you use the Set-Cookie format and don't specify a domain then
+    /// the cookie is sent for any domain (even after redirects are followed)
+    /// and cannot be modified by a server-set cookie. If a server sets a cookie
+    /// of the same name (or maybe you've imported one) then both will be sent
+    /// on a future transfer to that server, likely not what you intended.
+    /// address these issues set a domain in Set-Cookie or use the Netscape
+    /// format.
+    ///
+    /// Additionally, there are commands available that perform actions if you
+    /// pass in these exact strings:
+    ///
+    /// * "ALL" - erases all cookies held in memory
+    /// * "SESS" - erases all session cookies held in memory
+    /// * "FLUSH" - write all known cookies to the specified cookie jar
+    /// * "RELOAD" - reread all cookies from the cookie file
+    ///
+    /// By default this options corresponds to `CURLOPT_COOKIELIST`
+    pub fn cookie_list(&mut self, cookie: &str) -> Result<(), Error> {
+        let cookie = CString::new(cookie)?;
+        self.setopt_str(curl_sys::CURLOPT_COOKIELIST, &cookie)
+    }
+
+    /// Ask for a HTTP GET request.
+    ///
+    /// By default this option is `false` and corresponds to `CURLOPT_HTTPGET`.
+    pub fn get(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_HTTPGET, enable as c_long)
+    }
+
+    // /// Ask for a HTTP GET request.
+    // ///
+    // /// By default this option is `false` and corresponds to `CURLOPT_HTTPGET`.
+    // pub fn http_version(&mut self, vers: &str) -> Result<(), Error> {
+    //     self.setopt_long(curl_sys::CURLOPT_HTTPGET, enable as c_long)
+    // }
+
+    /// Ignore the content-length header.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_IGNORE_CONTENT_LENGTH`.
+    pub fn ignore_content_length(&mut self, ignore: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_IGNORE_CONTENT_LENGTH, ignore as c_long)
+    }
+
+    /// Enable or disable HTTP content decoding.
+    ///
+    /// By default this option is `true` and corresponds to
+    /// `CURLOPT_HTTP_CONTENT_DECODING`.
+    pub fn http_content_decoding(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_HTTP_CONTENT_DECODING, enable as c_long)
+    }
+
+    /// Enable or disable HTTP transfer decoding.
+    ///
+    /// By default this option is `true` and corresponds to
+    /// `CURLOPT_HTTP_TRANSFER_DECODING`.
+    pub fn http_transfer_decoding(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_HTTP_TRANSFER_DECODING, enable as c_long)
+    }
+
+    // /// Timeout for the Expect: 100-continue response
+    // ///
+    // /// By default this option is 1s and corresponds to
+    // /// `CURLOPT_EXPECT_100_TIMEOUT_MS`.
+    // pub fn expect_100_timeout(&mut self, enable: bool) -> Result<(), Error> {
+    //     self.setopt_long(curl_sys::CURLOPT_HTTP_TRANSFER_DECODING,
+    //                      enable as c_long)
+    // }
+
+    // /// Wait for pipelining/multiplexing.
+    // ///
+    // /// Tells libcurl to prefer to wait for a connection to confirm or deny that
+    // /// it can do pipelining or multiplexing before continuing.
+    // ///
+    // /// When about to perform a new transfer that allows pipelining or
+    // /// multiplexing, libcurl will check for existing connections to re-use and
+    // /// pipeline on. If no such connection exists it will immediately continue
+    // /// and create a fresh new connection to use.
+    // ///
+    // /// By setting this option to `true` - having `pipeline` enabled for the
+    // /// multi handle this transfer is associated with - libcurl will instead
+    // /// wait for the connection to reveal if it is possible to
+    // /// pipeline/multiplex on before it continues. This enables libcurl to much
+    // /// better keep the number of connections to a minimum when using pipelining
+    // /// or multiplexing protocols.
+    // ///
+    // /// The effect thus becomes that with this option set, libcurl prefers to
+    // /// wait and re-use an existing connection for pipelining rather than the
+    // /// opposite: prefer to open a new connection rather than waiting.
+    // ///
+    // /// The waiting time is as long as it takes for the connection to get up and
+    // /// for libcurl to get the necessary response back that informs it about its
+    // /// protocol and support level.
+    // pub fn http_pipewait(&mut self, enable: bool) -> Result<(), Error> {
+    // }
+
+    // =========================================================================
+    // Protocol Options
+
+    /// Indicates the range that this request should retrieve.
+    ///
+    /// The string provided should be of the form `N-M` where either `N` or `M`
+    /// can be left out. For HTTP transfers multiple ranges separated by commas
+    /// are also accepted.
+    ///
+    /// By default this option is not set and corresponds to `CURLOPT_RANGE`.
+    pub fn range(&mut self, range: &str) -> Result<(), Error> {
+        let range = CString::new(range)?;
+        self.setopt_str(curl_sys::CURLOPT_RANGE, &range)
+    }
+
+    /// Set a point to resume transfer from
+    ///
+    /// Specify the offset in bytes you want the transfer to start from.
+    ///
+    /// By default this option is 0 and corresponds to
+    /// `CURLOPT_RESUME_FROM_LARGE`.
+    pub fn resume_from(&mut self, from: u64) -> Result<(), Error> {
+        self.setopt_off_t(
+            curl_sys::CURLOPT_RESUME_FROM_LARGE,
+            from as curl_sys::curl_off_t,
+        )
+    }
+
+    /// Set a custom request string
+    ///
+    /// Specifies that a custom request will be made (e.g. a custom HTTP
+    /// method). This does not change how libcurl performs internally, just
+    /// changes the string sent to the server.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_CUSTOMREQUEST`.
+    pub fn custom_request(&mut self, request: &str) -> Result<(), Error> {
+        let request = CString::new(request)?;
+        self.setopt_str(curl_sys::CURLOPT_CUSTOMREQUEST, &request)
+    }
+
+    /// Get the modification time of the remote resource
+    ///
+    /// If true, libcurl will attempt to get the modification time of the
+    /// remote document in this operation. This requires that the remote server
+    /// sends the time or replies to a time querying command. The `filetime`
+    /// function can be used after a transfer to extract the received time (if
+    /// any).
+    ///
+    /// By default this option is `false` and corresponds to `CURLOPT_FILETIME`
+    pub fn fetch_filetime(&mut self, fetch: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_FILETIME, fetch as c_long)
+    }
+
+    /// Indicate whether to download the request without getting the body
+    ///
+    /// This is useful, for example, for doing a HEAD request.
+    ///
+    /// By default this option is `false` and corresponds to `CURLOPT_NOBODY`.
+    pub fn nobody(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_NOBODY, enable as c_long)
+    }
+
+    /// Set the size of the input file to send off.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_INFILESIZE_LARGE`.
+    pub fn in_filesize(&mut self, size: u64) -> Result<(), Error> {
+        self.setopt_off_t(
+            curl_sys::CURLOPT_INFILESIZE_LARGE,
+            size as curl_sys::curl_off_t,
+        )
+    }
+
+    /// Enable or disable data upload.
+    ///
+    /// This means that a PUT request will be made for HTTP and probably wants
+    /// to be combined with the read callback as well as the `in_filesize`
+    /// method.
+    ///
+    /// By default this option is `false` and corresponds to `CURLOPT_UPLOAD`.
+    pub fn upload(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_UPLOAD, enable as c_long)
+    }
+
+    /// Configure the maximum file size to download.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_MAXFILESIZE_LARGE`.
+    pub fn max_filesize(&mut self, size: u64) -> Result<(), Error> {
+        self.setopt_off_t(
+            curl_sys::CURLOPT_MAXFILESIZE_LARGE,
+            size as curl_sys::curl_off_t,
+        )
+    }
+
+    /// Selects a condition for a time request.
+    ///
+    /// This value indicates how the `time_value` option is interpreted.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_TIMECONDITION`.
+    pub fn time_condition(&mut self, cond: TimeCondition) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_TIMECONDITION, cond as c_long)
+    }
+
+    /// Sets the time value for a conditional request.
+    ///
+    /// The value here should be the number of seconds elapsed since January 1,
+    /// 1970. To pass how to interpret this value, use `time_condition`.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_TIMEVALUE`.
+    pub fn time_value(&mut self, val: i64) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_TIMEVALUE, val as c_long)
+    }
+
+    // =========================================================================
+    // Connection Options
+
+    /// Set maximum time the request is allowed to take.
+    ///
+    /// Normally, name lookups can take a considerable time and limiting
+    /// operations to less than a few minutes risk aborting perfectly normal
+    /// operations.
+    ///
+    /// If libcurl is built to use the standard system name resolver, that
+    /// portion of the transfer will still use full-second resolution for
+    /// timeouts with a minimum timeout allowed of one second.
+    ///
+    /// In unix-like systems, this might cause signals to be used unless
+    /// `nosignal` is set.
+    ///
+    /// Since this puts a hard limit for how long a request is allowed to
+    /// take, it has limited use in dynamic use cases with varying transfer
+    /// times. You are then advised to explore `low_speed_limit`,
+    /// `low_speed_time` or using `progress_function` to implement your own
+    /// timeout logic.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_TIMEOUT_MS`.
+    pub fn timeout(&mut self, timeout: Duration) -> Result<(), Error> {
+        let ms = timeout.as_millis();
+        match c_long::try_from(ms) {
+            Ok(amt) => self.setopt_long(curl_sys::CURLOPT_TIMEOUT_MS, amt),
+            Err(_) => {
+                let amt = c_long::try_from(ms / 1000)
+                    .map_err(|_| Error::new(curl_sys::CURLE_BAD_FUNCTION_ARGUMENT))?;
+                self.setopt_long(curl_sys::CURLOPT_TIMEOUT, amt)
+            }
+        }
+    }
+
+    /// Set the low speed limit in bytes per second.
+    ///
+    /// This specifies the average transfer speed in bytes per second that the
+    /// transfer should be below during `low_speed_time` for libcurl to consider
+    /// it to be too slow and abort.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_LOW_SPEED_LIMIT`.
+    pub fn low_speed_limit(&mut self, limit: u32) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_LOW_SPEED_LIMIT, limit as c_long)
+    }
+
+    /// Set the low speed time period.
+    ///
+    /// Specifies the window of time for which if the transfer rate is below
+    /// `low_speed_limit` the request will be aborted.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_LOW_SPEED_TIME`.
+    pub fn low_speed_time(&mut self, dur: Duration) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_LOW_SPEED_TIME, dur.as_secs() as c_long)
+    }
+
+    /// Rate limit data upload speed
+    ///
+    /// If an upload exceeds this speed (counted in bytes per second) on
+    /// cumulative average during the transfer, the transfer will pause to keep
+    /// the average rate less than or equal to the parameter value.
+    ///
+    /// By default this option is not set (unlimited speed) and corresponds to
+    /// `CURLOPT_MAX_SEND_SPEED_LARGE`.
+    pub fn max_send_speed(&mut self, speed: u64) -> Result<(), Error> {
+        self.setopt_off_t(
+            curl_sys::CURLOPT_MAX_SEND_SPEED_LARGE,
+            speed as curl_sys::curl_off_t,
+        )
+    }
+
+    /// Rate limit data download speed
+    ///
+    /// If a download exceeds this speed (counted in bytes per second) on
+    /// cumulative average during the transfer, the transfer will pause to keep
+    /// the average rate less than or equal to the parameter value.
+    ///
+    /// By default this option is not set (unlimited speed) and corresponds to
+    /// `CURLOPT_MAX_RECV_SPEED_LARGE`.
+    pub fn max_recv_speed(&mut self, speed: u64) -> Result<(), Error> {
+        self.setopt_off_t(
+            curl_sys::CURLOPT_MAX_RECV_SPEED_LARGE,
+            speed as curl_sys::curl_off_t,
+        )
+    }
+
+    /// Set the maximum connection cache size.
+    ///
+    /// The set amount will be the maximum number of simultaneously open
+    /// persistent connections that libcurl may cache in the pool associated
+    /// with this handle. The default is 5, and there isn't much point in
+    /// changing this value unless you are perfectly aware of how this works and
+    /// changes libcurl's behaviour. This concerns connections using any of the
+    /// protocols that support persistent connections.
+    ///
+    /// When reaching the maximum limit, curl closes the oldest one in the cache
+    /// to prevent increasing the number of open connections.
+    ///
+    /// By default this option is set to 5 and corresponds to
+    /// `CURLOPT_MAXCONNECTS`
+    pub fn max_connects(&mut self, max: u32) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_MAXCONNECTS, max as c_long)
+    }
+
+    /// Set the maximum idle time allowed for a connection.
+    ///
+    /// This configuration sets the maximum time that a connection inside of the connection cache
+    /// can be reused. Any connection older than this value will be considered stale and will
+    /// be closed.
+    ///
+    /// By default, a value of 118 seconds is used.
+    pub fn maxage_conn(&mut self, max_age: Duration) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_MAXAGE_CONN, max_age.as_secs() as c_long)
+    }
+
+    /// Force a new connection to be used.
+    ///
+    /// Makes the next transfer use a new (fresh) connection by force instead of
+    /// trying to re-use an existing one. This option should be used with
+    /// caution and only if you understand what it does as it may seriously
+    /// impact performance.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_FRESH_CONNECT`.
+    pub fn fresh_connect(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_FRESH_CONNECT, enable as c_long)
+    }
+
+    /// Make connection get closed at once after use.
+    ///
+    /// Makes libcurl explicitly close the connection when done with the
+    /// transfer. Normally, libcurl keeps all connections alive when done with
+    /// one transfer in case a succeeding one follows that can re-use them.
+    /// This option should be used with caution and only if you understand what
+    /// it does as it can seriously impact performance.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_FORBID_REUSE`.
+    pub fn forbid_reuse(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_FORBID_REUSE, enable as c_long)
+    }
+
+    /// Timeout for the connect phase
+    ///
+    /// This is the maximum time that you allow the connection phase to the
+    /// server to take. This only limits the connection phase, it has no impact
+    /// once it has connected.
+    ///
+    /// By default this value is 300 seconds and corresponds to
+    /// `CURLOPT_CONNECTTIMEOUT_MS`.
+    pub fn connect_timeout(&mut self, timeout: Duration) -> Result<(), Error> {
+        let ms = timeout.as_millis();
+        match c_long::try_from(ms) {
+            Ok(amt) => self.setopt_long(curl_sys::CURLOPT_CONNECTTIMEOUT_MS, amt),
+            Err(_) => {
+                let amt = c_long::try_from(ms / 1000)
+                    .map_err(|_| Error::new(curl_sys::CURLE_BAD_FUNCTION_ARGUMENT))?;
+                self.setopt_long(curl_sys::CURLOPT_CONNECTTIMEOUT, amt)
+            }
+        }
+    }
+
+    /// Specify which IP protocol version to use
+    ///
+    /// Allows an application to select what kind of IP addresses to use when
+    /// resolving host names. This is only interesting when using host names
+    /// that resolve addresses using more than one version of IP.
+    ///
+    /// By default this value is "any" and corresponds to `CURLOPT_IPRESOLVE`.
+    pub fn ip_resolve(&mut self, resolve: IpResolve) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_IPRESOLVE, resolve as c_long)
+    }
+
+    /// Specify custom host name to IP address resolves.
+    ///
+    /// Allows specifying hostname to IP mappins to use before trying the
+    /// system resolver.
+    ///
+    /// # Examples
+    ///
+    /// ```no_run
+    /// use curl::easy::{Easy, List};
+    ///
+    /// let mut list = List::new();
+    /// list.append("www.rust-lang.org:443:185.199.108.153").unwrap();
+    ///
+    /// let mut handle = Easy::new();
+    /// handle.url("https://www.rust-lang.org/").unwrap();
+    /// handle.resolve(list).unwrap();
+    /// handle.perform().unwrap();
+    /// ```
+    pub fn resolve(&mut self, list: List) -> Result<(), Error> {
+        let ptr = list::raw(&list);
+        self.inner.resolve_list = Some(list);
+        self.setopt_ptr(curl_sys::CURLOPT_RESOLVE, ptr as *const _)
+    }
+
+    /// Configure whether to stop when connected to target server
+    ///
+    /// When enabled it tells the library to perform all the required proxy
+    /// authentication and connection setup, but no data transfer, and then
+    /// return.
+    ///
+    /// The option can be used to simply test a connection to a server.
+    ///
+    /// By default this value is `false` and corresponds to
+    /// `CURLOPT_CONNECT_ONLY`.
+    pub fn connect_only(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_CONNECT_ONLY, enable as c_long)
+    }
+
+    // /// Set interface to speak DNS over.
+    // ///
+    // /// Set the name of the network interface that the DNS resolver should bind
+    // /// to. This must be an interface name (not an address).
+    // ///
+    // /// By default this option is not set and corresponds to
+    // /// `CURLOPT_DNS_INTERFACE`.
+    // pub fn dns_interface(&mut self, interface: &str) -> Result<(), Error> {
+    //     let interface = CString::new(interface)?;
+    //     self.setopt_str(curl_sys::CURLOPT_DNS_INTERFACE, &interface)
+    // }
+    //
+    // /// IPv4 address to bind DNS resolves to
+    // ///
+    // /// Set the local IPv4 address that the resolver should bind to. The
+    // /// argument should be of type char * and contain a single numerical IPv4
+    // /// address as a string.
+    // ///
+    // /// By default this option is not set and corresponds to
+    // /// `CURLOPT_DNS_LOCAL_IP4`.
+    // pub fn dns_local_ip4(&mut self, ip: &str) -> Result<(), Error> {
+    //     let ip = CString::new(ip)?;
+    //     self.setopt_str(curl_sys::CURLOPT_DNS_LOCAL_IP4, &ip)
+    // }
+    //
+    // /// IPv6 address to bind DNS resolves to
+    // ///
+    // /// Set the local IPv6 address that the resolver should bind to. The
+    // /// argument should be of type char * and contain a single numerical IPv6
+    // /// address as a string.
+    // ///
+    // /// By default this option is not set and corresponds to
+    // /// `CURLOPT_DNS_LOCAL_IP6`.
+    // pub fn dns_local_ip6(&mut self, ip: &str) -> Result<(), Error> {
+    //     let ip = CString::new(ip)?;
+    //     self.setopt_str(curl_sys::CURLOPT_DNS_LOCAL_IP6, &ip)
+    // }
+    //
+    // /// Set preferred DNS servers.
+    // ///
+    // /// Provides a list of DNS servers to be used instead of the system default.
+    // /// The format of the dns servers option is:
+    // ///
+    // /// ```text
+    // /// host[:port],[host[:port]]...
+    // /// ```
+    // ///
+    // /// By default this option is not set and corresponds to
+    // /// `CURLOPT_DNS_SERVERS`.
+    // pub fn dns_servers(&mut self, servers: &str) -> Result<(), Error> {
+    //     let servers = CString::new(servers)?;
+    //     self.setopt_str(curl_sys::CURLOPT_DNS_SERVERS, &servers)
+    // }
+
+    // =========================================================================
+    // SSL/Security Options
+
+    /// Sets the SSL client certificate.
+    ///
+    /// The string should be the file name of your client certificate. The
+    /// default format is "P12" on Secure Transport and "PEM" on other engines,
+    /// and can be changed with `ssl_cert_type`.
+    ///
+    /// With NSS or Secure Transport, this can also be the nickname of the
+    /// certificate you wish to authenticate with as it is named in the security
+    /// database. If you want to use a file from the current directory, please
+    /// precede it with "./" prefix, in order to avoid confusion with a
+    /// nickname.
+    ///
+    /// When using a client certificate, you most likely also need to provide a
+    /// private key with `ssl_key`.
+    ///
+    /// By default this option is not set and corresponds to `CURLOPT_SSLCERT`.
+    pub fn ssl_cert<P: AsRef<Path>>(&mut self, cert: P) -> Result<(), Error> {
+        self.setopt_path(curl_sys::CURLOPT_SSLCERT, cert.as_ref())
+    }
+
+    /// Set the SSL client certificate using an in-memory blob.
+    ///
+    /// The specified byte buffer should contain the binary content of your
+    /// client certificate, which will be copied into the handle. The format of
+    /// the certificate can be specified with `ssl_cert_type`.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_SSLCERT_BLOB`.
+    pub fn ssl_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.setopt_blob(curl_sys::CURLOPT_SSLCERT_BLOB, blob)
+    }
+
+    /// Specify type of the client SSL certificate.
+    ///
+    /// The string should be the format of your certificate. Supported formats
+    /// are "PEM" and "DER", except with Secure Transport. OpenSSL (versions
+    /// 0.9.3 and later) and Secure Transport (on iOS 5 or later, or OS X 10.7
+    /// or later) also support "P12" for PKCS#12-encoded files.
+    ///
+    /// By default this option is "PEM" and corresponds to
+    /// `CURLOPT_SSLCERTTYPE`.
+    pub fn ssl_cert_type(&mut self, kind: &str) -> Result<(), Error> {
+        let kind = CString::new(kind)?;
+        self.setopt_str(curl_sys::CURLOPT_SSLCERTTYPE, &kind)
+    }
+
+    /// Specify private keyfile for TLS and SSL client cert.
+    ///
+    /// The string should be the file name of your private key. The default
+    /// format is "PEM" and can be changed with `ssl_key_type`.
+    ///
+    /// (iOS and Mac OS X only) This option is ignored if curl was built against
+    /// Secure Transport. Secure Transport expects the private key to be already
+    /// present in the keychain or PKCS#12 file containing the certificate.
+    ///
+    /// By default this option is not set and corresponds to `CURLOPT_SSLKEY`.
+    pub fn ssl_key<P: AsRef<Path>>(&mut self, key: P) -> Result<(), Error> {
+        self.setopt_path(curl_sys::CURLOPT_SSLKEY, key.as_ref())
+    }
+
+    /// Specify an SSL private key using an in-memory blob.
+    ///
+    /// The specified byte buffer should contain the binary content of your
+    /// private key, which will be copied into the handle. The format of
+    /// the private key can be specified with `ssl_key_type`.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_SSLKEY_BLOB`.
+    pub fn ssl_key_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.setopt_blob(curl_sys::CURLOPT_SSLKEY_BLOB, blob)
+    }
+
+    /// Set type of the private key file.
+    ///
+    /// The string should be the format of your private key. Supported formats
+    /// are "PEM", "DER" and "ENG".
+    ///
+    /// The format "ENG" enables you to load the private key from a crypto
+    /// engine. In this case `ssl_key` is used as an identifier passed to
+    /// the engine. You have to set the crypto engine with `ssl_engine`.
+    /// "DER" format key file currently does not work because of a bug in
+    /// OpenSSL.
+    ///
+    /// By default this option is "PEM" and corresponds to
+    /// `CURLOPT_SSLKEYTYPE`.
+    pub fn ssl_key_type(&mut self, kind: &str) -> Result<(), Error> {
+        let kind = CString::new(kind)?;
+        self.setopt_str(curl_sys::CURLOPT_SSLKEYTYPE, &kind)
+    }
+
+    /// Set passphrase to private key.
+    ///
+    /// This will be used as the password required to use the `ssl_key`.
+    /// You never needed a pass phrase to load a certificate but you need one to
+    /// load your private key.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_KEYPASSWD`.
+    pub fn key_password(&mut self, password: &str) -> Result<(), Error> {
+        let password = CString::new(password)?;
+        self.setopt_str(curl_sys::CURLOPT_KEYPASSWD, &password)
+    }
+
+    /// Set the SSL Certificate Authorities using an in-memory blob.
+    ///
+    /// The specified byte buffer should contain the binary content of one
+    /// or more PEM-encoded CA certificates, which will be copied into
+    /// the handle.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_CAINFO_BLOB`.
+    pub fn ssl_cainfo_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.setopt_blob(curl_sys::CURLOPT_CAINFO_BLOB, blob)
+    }
+
+    /// Set the SSL Certificate Authorities for HTTPS proxies using an in-memory
+    /// blob.
+    ///
+    /// The specified byte buffer should contain the binary content of one
+    /// or more PEM-encoded CA certificates, which will be copied into
+    /// the handle.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_PROXY_CAINFO_BLOB`.
+    pub fn proxy_ssl_cainfo_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.setopt_blob(curl_sys::CURLOPT_PROXY_CAINFO_BLOB, blob)
+    }
+
+    /// Set the SSL engine identifier.
+    ///
+    /// This will be used as the identifier for the crypto engine you want to
+    /// use for your private key.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_SSLENGINE`.
+    pub fn ssl_engine(&mut self, engine: &str) -> Result<(), Error> {
+        let engine = CString::new(engine)?;
+        self.setopt_str(curl_sys::CURLOPT_SSLENGINE, &engine)
+    }
+
+    /// Make this handle's SSL engine the default.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_SSLENGINE_DEFAULT`.
+    pub fn ssl_engine_default(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_SSLENGINE_DEFAULT, enable as c_long)
+    }
+
+    // /// Enable TLS false start.
+    // ///
+    // /// This option determines whether libcurl should use false start during the
+    // /// TLS handshake. False start is a mode where a TLS client will start
+    // /// sending application data before verifying the server's Finished message,
+    // /// thus saving a round trip when performing a full handshake.
+    // ///
+    // /// By default this option is not set and corresponds to
+    // /// `CURLOPT_SSL_FALSESTARTE`.
+    // pub fn ssl_false_start(&mut self, enable: bool) -> Result<(), Error> {
+    //     self.setopt_long(curl_sys::CURLOPT_SSLENGINE_DEFAULT, enable as c_long)
+    // }
+
+    /// Set preferred HTTP version.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_HTTP_VERSION`.
+    pub fn http_version(&mut self, version: HttpVersion) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_HTTP_VERSION, version as c_long)
+    }
+
+    /// Set preferred TLS/SSL version.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_SSLVERSION`.
+    pub fn ssl_version(&mut self, version: SslVersion) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_SSLVERSION, version as c_long)
+    }
+
+    /// Set preferred TLS/SSL version when connecting to an HTTPS proxy.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_PROXY_SSLVERSION`.
+    pub fn proxy_ssl_version(&mut self, version: SslVersion) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_PROXY_SSLVERSION, version as c_long)
+    }
+
+    /// Set preferred TLS/SSL version with minimum version and maximum version.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_SSLVERSION`.
+    pub fn ssl_min_max_version(
+        &mut self,
+        min_version: SslVersion,
+        max_version: SslVersion,
+    ) -> Result<(), Error> {
+        let version = (min_version as c_long) | ((max_version as c_long) << 16);
+        self.setopt_long(curl_sys::CURLOPT_SSLVERSION, version)
+    }
+
+    /// Set preferred TLS/SSL version with minimum version and maximum version
+    /// when connecting to an HTTPS proxy.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_PROXY_SSLVERSION`.
+    pub fn proxy_ssl_min_max_version(
+        &mut self,
+        min_version: SslVersion,
+        max_version: SslVersion,
+    ) -> Result<(), Error> {
+        let version = (min_version as c_long) | ((max_version as c_long) << 16);
+        self.setopt_long(curl_sys::CURLOPT_PROXY_SSLVERSION, version)
+    }
+
+    /// Verify the certificate's name against host.
+    ///
+    /// This should be disabled with great caution! It basically disables the
+    /// security features of SSL if it is disabled.
+    ///
+    /// By default this option is set to `true` and corresponds to
+    /// `CURLOPT_SSL_VERIFYHOST`.
+    pub fn ssl_verify_host(&mut self, verify: bool) -> Result<(), Error> {
+        let val = if verify { 2 } else { 0 };
+        self.setopt_long(curl_sys::CURLOPT_SSL_VERIFYHOST, val)
+    }
+
+    /// Verify the certificate's name against host for HTTPS proxy.
+    ///
+    /// This should be disabled with great caution! It basically disables the
+    /// security features of SSL if it is disabled.
+    ///
+    /// By default this option is set to `true` and corresponds to
+    /// `CURLOPT_PROXY_SSL_VERIFYHOST`.
+    pub fn proxy_ssl_verify_host(&mut self, verify: bool) -> Result<(), Error> {
+        let val = if verify { 2 } else { 0 };
+        self.setopt_long(curl_sys::CURLOPT_PROXY_SSL_VERIFYHOST, val)
+    }
+
+    /// Verify the peer's SSL certificate.
+    ///
+    /// This should be disabled with great caution! It basically disables the
+    /// security features of SSL if it is disabled.
+    ///
+    /// By default this option is set to `true` and corresponds to
+    /// `CURLOPT_SSL_VERIFYPEER`.
+    pub fn ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_SSL_VERIFYPEER, verify as c_long)
+    }
+
+    /// Verify the peer's SSL certificate for HTTPS proxy.
+    ///
+    /// This should be disabled with great caution! It basically disables the
+    /// security features of SSL if it is disabled.
+    ///
+    /// By default this option is set to `true` and corresponds to
+    /// `CURLOPT_PROXY_SSL_VERIFYPEER`.
+    pub fn proxy_ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_PROXY_SSL_VERIFYPEER, verify as c_long)
+    }
+
+    // /// Verify the certificate's status.
+    // ///
+    // /// This option determines whether libcurl verifies the status of the server
+    // /// cert using the "Certificate Status Request" TLS extension (aka. OCSP
+    // /// stapling).
+    // ///
+    // /// By default this option is set to `false` and corresponds to
+    // /// `CURLOPT_SSL_VERIFYSTATUS`.
+    // pub fn ssl_verify_status(&mut self, verify: bool) -> Result<(), Error> {
+    //     self.setopt_long(curl_sys::CURLOPT_SSL_VERIFYSTATUS, verify as c_long)
+    // }
+
+    /// Specify the path to Certificate Authority (CA) bundle
+    ///
+    /// The file referenced should hold one or more certificates to verify the
+    /// peer with.
+    ///
+    /// This option is by default set to the system path where libcurl's cacert
+    /// bundle is assumed to be stored, as established at build time.
+    ///
+    /// If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module
+    /// (libnsspem.so) needs to be available for this option to work properly.
+    ///
+    /// By default this option is the system defaults, and corresponds to
+    /// `CURLOPT_CAINFO`.
+    pub fn cainfo<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.setopt_path(curl_sys::CURLOPT_CAINFO, path.as_ref())
+    }
+
+    /// Set the issuer SSL certificate filename
+    ///
+    /// Specifies a file holding a CA certificate in PEM format. If the option
+    /// is set, an additional check against the peer certificate is performed to
+    /// verify the issuer is indeed the one associated with the certificate
+    /// provided by the option. This additional check is useful in multi-level
+    /// PKI where one needs to enforce that the peer certificate is from a
+    /// specific branch of the tree.
+    ///
+    /// This option makes sense only when used in combination with the
+    /// [`Easy2::ssl_verify_peer`] option. Otherwise, the result of the check is
+    /// not considered as failure.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_ISSUERCERT`.
+    pub fn issuer_cert<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.setopt_path(curl_sys::CURLOPT_ISSUERCERT, path.as_ref())
+    }
+
+    /// Set the issuer SSL certificate filename for HTTPS proxies
+    ///
+    /// Specifies a file holding a CA certificate in PEM format. If the option
+    /// is set, an additional check against the peer certificate is performed to
+    /// verify the issuer is indeed the one associated with the certificate
+    /// provided by the option. This additional check is useful in multi-level
+    /// PKI where one needs to enforce that the peer certificate is from a
+    /// specific branch of the tree.
+    ///
+    /// This option makes sense only when used in combination with the
+    /// [`Easy2::proxy_ssl_verify_peer`] option. Otherwise, the result of the
+    /// check is not considered as failure.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_PROXY_ISSUERCERT`.
+    pub fn proxy_issuer_cert<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.setopt_path(curl_sys::CURLOPT_PROXY_ISSUERCERT, path.as_ref())
+    }
+
+    /// Set the issuer SSL certificate using an in-memory blob.
+    ///
+    /// The specified byte buffer should contain the binary content of a CA
+    /// certificate in the PEM format. The certificate will be copied into the
+    /// handle.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_ISSUERCERT_BLOB`.
+    pub fn issuer_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.setopt_blob(curl_sys::CURLOPT_ISSUERCERT_BLOB, blob)
+    }
+
+    /// Set the issuer SSL certificate for HTTPS proxies using an in-memory blob.
+    ///
+    /// The specified byte buffer should contain the binary content of a CA
+    /// certificate in the PEM format. The certificate will be copied into the
+    /// handle.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_PROXY_ISSUERCERT_BLOB`.
+    pub fn proxy_issuer_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+        self.setopt_blob(curl_sys::CURLOPT_PROXY_ISSUERCERT_BLOB, blob)
+    }
+
+    /// Specify directory holding CA certificates
+    ///
+    /// Names a directory holding multiple CA certificates to verify the peer
+    /// with. If libcurl is built against OpenSSL, the certificate directory
+    /// must be prepared using the openssl c_rehash utility. This makes sense
+    /// only when used in combination with the `ssl_verify_peer` option.
+    ///
+    /// By default this option is not set and corresponds to `CURLOPT_CAPATH`.
+    pub fn capath<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.setopt_path(curl_sys::CURLOPT_CAPATH, path.as_ref())
+    }
+
+    /// Specify a Certificate Revocation List file
+    ///
+    /// Names a file with the concatenation of CRL (in PEM format) to use in the
+    /// certificate validation that occurs during the SSL exchange.
+    ///
+    /// When curl is built to use NSS or GnuTLS, there is no way to influence
+    /// the use of CRL passed to help in the verification process. When libcurl
+    /// is built with OpenSSL support, X509_V_FLAG_CRL_CHECK and
+    /// X509_V_FLAG_CRL_CHECK_ALL are both set, requiring CRL check against all
+    /// the elements of the certificate chain if a CRL file is passed.
+    ///
+    /// This option makes sense only when used in combination with the
+    /// [`Easy2::ssl_verify_peer`] option.
+    ///
+    /// A specific error code (`is_ssl_crl_badfile`) is defined with the
+    /// option. It is returned when the SSL exchange fails because the CRL file
+    /// cannot be loaded. A failure in certificate verification due to a
+    /// revocation information found in the CRL does not trigger this specific
+    /// error.
+    ///
+    /// By default this option is not set and corresponds to `CURLOPT_CRLFILE`.
+    pub fn crlfile<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.setopt_path(curl_sys::CURLOPT_CRLFILE, path.as_ref())
+    }
+
+    /// Specify a Certificate Revocation List file to use when connecting to an
+    /// HTTPS proxy.
+    ///
+    /// Names a file with the concatenation of CRL (in PEM format) to use in the
+    /// certificate validation that occurs during the SSL exchange.
+    ///
+    /// When curl is built to use NSS or GnuTLS, there is no way to influence
+    /// the use of CRL passed to help in the verification process. When libcurl
+    /// is built with OpenSSL support, X509_V_FLAG_CRL_CHECK and
+    /// X509_V_FLAG_CRL_CHECK_ALL are both set, requiring CRL check against all
+    /// the elements of the certificate chain if a CRL file is passed.
+    ///
+    /// This option makes sense only when used in combination with the
+    /// [`Easy2::proxy_ssl_verify_peer`] option.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_PROXY_CRLFILE`.
+    pub fn proxy_crlfile<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
+        self.setopt_path(curl_sys::CURLOPT_PROXY_CRLFILE, path.as_ref())
+    }
+
+    /// Request SSL certificate information
+    ///
+    /// Enable libcurl's certificate chain info gatherer. With this enabled,
+    /// libcurl will extract lots of information and data about the certificates
+    /// in the certificate chain used in the SSL connection.
+    ///
+    /// By default this option is `false` and corresponds to
+    /// `CURLOPT_CERTINFO`.
+    pub fn certinfo(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_CERTINFO, enable as c_long)
+    }
+
+    /// Set pinned public key.
+    ///
+    /// Pass a pointer to a zero terminated string as parameter. The string can
+    /// be the file name of your pinned public key. The file format expected is
+    /// "PEM" or "DER". The string can also be any number of base64 encoded
+    /// sha256 hashes preceded by "sha256//" and separated by ";"
+    ///
+    /// When negotiating a TLS or SSL connection, the server sends a certificate
+    /// indicating its identity. A public key is extracted from this certificate
+    /// and if it does not exactly match the public key provided to this option,
+    /// curl will abort the connection before sending or receiving any data.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_PINNEDPUBLICKEY`.
+    pub fn pinned_public_key(&mut self, pubkey: &str) -> Result<(), Error> {
+        let key = CString::new(pubkey)?;
+        self.setopt_str(curl_sys::CURLOPT_PINNEDPUBLICKEY, &key)
+    }
+
+    /// Specify a source for random data
+    ///
+    /// The file will be used to read from to seed the random engine for SSL and
+    /// more.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_RANDOM_FILE`.
+    pub fn random_file<P: AsRef<Path>>(&mut self, p: P) -> Result<(), Error> {
+        self.setopt_path(curl_sys::CURLOPT_RANDOM_FILE, p.as_ref())
+    }
+
+    /// Specify EGD socket path.
+    ///
+    /// Indicates the path name to the Entropy Gathering Daemon socket. It will
+    /// be used to seed the random engine for SSL.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_EGDSOCKET`.
+    pub fn egd_socket<P: AsRef<Path>>(&mut self, p: P) -> Result<(), Error> {
+        self.setopt_path(curl_sys::CURLOPT_EGDSOCKET, p.as_ref())
+    }
+
+    /// Specify ciphers to use for TLS.
+    ///
+    /// Holds the list of ciphers to use for the SSL connection. The list must
+    /// be syntactically correct, it consists of one or more cipher strings
+    /// separated by colons. Commas or spaces are also acceptable separators
+    /// but colons are normally used, !, - and + can be used as operators.
+    ///
+    /// For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA',
+    /// ´SHA1+DES´, 'TLSv1' and 'DEFAULT'. The default list is normally set when
+    /// you compile OpenSSL.
+    ///
+    /// You'll find more details about cipher lists on this URL:
+    ///
+    /// <https://www.openssl.org/docs/apps/ciphers.html>
+    ///
+    /// For NSS, valid examples of cipher lists include 'rsa_rc4_128_md5',
+    /// ´rsa_aes_128_sha´, etc. With NSS you don't add/remove ciphers. If one
+    /// uses this option then all known ciphers are disabled and only those
+    /// passed in are enabled.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_SSL_CIPHER_LIST`.
+    pub fn ssl_cipher_list(&mut self, ciphers: &str) -> Result<(), Error> {
+        let ciphers = CString::new(ciphers)?;
+        self.setopt_str(curl_sys::CURLOPT_SSL_CIPHER_LIST, &ciphers)
+    }
+
+    /// Specify ciphers to use for TLS for an HTTPS proxy.
+    ///
+    /// Holds the list of ciphers to use for the SSL connection. The list must
+    /// be syntactically correct, it consists of one or more cipher strings
+    /// separated by colons. Commas or spaces are also acceptable separators
+    /// but colons are normally used, !, - and + can be used as operators.
+    ///
+    /// For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA',
+    /// ´SHA1+DES´, 'TLSv1' and 'DEFAULT'. The default list is normally set when
+    /// you compile OpenSSL.
+    ///
+    /// You'll find more details about cipher lists on this URL:
+    ///
+    /// <https://www.openssl.org/docs/apps/ciphers.html>
+    ///
+    /// For NSS, valid examples of cipher lists include 'rsa_rc4_128_md5',
+    /// ´rsa_aes_128_sha´, etc. With NSS you don't add/remove ciphers. If one
+    /// uses this option then all known ciphers are disabled and only those
+    /// passed in are enabled.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_PROXY_SSL_CIPHER_LIST`.
+    pub fn proxy_ssl_cipher_list(&mut self, ciphers: &str) -> Result<(), Error> {
+        let ciphers = CString::new(ciphers)?;
+        self.setopt_str(curl_sys::CURLOPT_PROXY_SSL_CIPHER_LIST, &ciphers)
+    }
+
+    /// Enable or disable use of the SSL session-ID cache
+    ///
+    /// By default all transfers are done using the cache enabled. While nothing
+    /// ever should get hurt by attempting to reuse SSL session-IDs, there seem
+    /// to be or have been broken SSL implementations in the wild that may
+    /// require you to disable this in order for you to succeed.
+    ///
+    /// This corresponds to the `CURLOPT_SSL_SESSIONID_CACHE` option.
+    pub fn ssl_sessionid_cache(&mut self, enable: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_SSL_SESSIONID_CACHE, enable as c_long)
+    }
+
+    /// Set SSL behavior options
+    ///
+    /// Inform libcurl about SSL specific behaviors.
+    ///
+    /// This corresponds to the `CURLOPT_SSL_OPTIONS` option.
+    pub fn ssl_options(&mut self, bits: &SslOpt) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_SSL_OPTIONS, bits.bits)
+    }
+
+    /// Set SSL behavior options for proxies
+    ///
+    /// Inform libcurl about SSL specific behaviors.
+    ///
+    /// This corresponds to the `CURLOPT_PROXY_SSL_OPTIONS` option.
+    pub fn proxy_ssl_options(&mut self, bits: &SslOpt) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_PROXY_SSL_OPTIONS, bits.bits)
+    }
+
+    // /// Stores a private pointer-sized piece of data.
+    // ///
+    // /// This can be retrieved through the `private` function and otherwise
+    // /// libcurl does not tamper with this value. This corresponds to
+    // /// `CURLOPT_PRIVATE` and defaults to 0.
+    // pub fn set_private(&mut self, private: usize) -> Result<(), Error> {
+    //     self.setopt_ptr(curl_sys::CURLOPT_PRIVATE, private as *const _)
+    // }
+    //
+    // /// Fetches this handle's private pointer-sized piece of data.
+    // ///
+    // /// This corresponds to `CURLINFO_PRIVATE` and defaults to 0.
+    // pub fn private(&self) -> Result<usize, Error> {
+    //     self.getopt_ptr(curl_sys::CURLINFO_PRIVATE).map(|p| p as usize)
+    // }
+
+    // =========================================================================
+    // getters
+
+    /// Set maximum time to wait for Expect 100 request before sending body.
+    ///
+    /// `curl` has internal heuristics that trigger the use of a `Expect`
+    /// header for large enough request bodies where the client first sends the
+    /// request header along with an `Expect: 100-continue` header. The server
+    /// is supposed to validate the headers and respond with a `100` response
+    /// status code after which `curl` will send the actual request body.
+    ///
+    /// However, if the server does not respond to the initial request
+    /// within `CURLOPT_EXPECT_100_TIMEOUT_MS` then `curl` will send the
+    /// request body anyways.
+    ///
+    /// The best-case scenario is where the request is invalid and the server
+    /// replies with a `417 Expectation Failed` without having to wait for or process
+    /// the request body at all. However, this behaviour can also lead to higher
+    /// total latency since in the best case, an additional server roundtrip is required
+    /// and in the worst case, the request is delayed by `CURLOPT_EXPECT_100_TIMEOUT_MS`.
+    ///
+    /// More info: <https://curl.se/libcurl/c/CURLOPT_EXPECT_100_TIMEOUT_MS.html>
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_EXPECT_100_TIMEOUT_MS`.
+    pub fn expect_100_timeout(&mut self, timeout: Duration) -> Result<(), Error> {
+        let ms = timeout.as_secs() * 1000 + timeout.subsec_millis() as u64;
+        self.setopt_long(curl_sys::CURLOPT_EXPECT_100_TIMEOUT_MS, ms as c_long)
+    }
+
+    /// Get info on unmet time conditional
+    ///
+    /// Returns if the condition provided in the previous request didn't match
+    ///
+    //// This corresponds to `CURLINFO_CONDITION_UNMET` and may return an error if the
+    /// option is not supported
+    pub fn time_condition_unmet(&self) -> Result<bool, Error> {
+        self.getopt_long(curl_sys::CURLINFO_CONDITION_UNMET)
+            .map(|r| r != 0)
+    }
+
+    /// Get the last used URL
+    ///
+    /// In cases when you've asked libcurl to follow redirects, it may
+    /// not be the same value you set with `url`.
+    ///
+    /// This methods corresponds to the `CURLINFO_EFFECTIVE_URL` option.
+    ///
+    /// Returns `Ok(None)` if no effective url is listed or `Err` if an error
+    /// happens or the underlying bytes aren't valid utf-8.
+    pub fn effective_url(&self) -> Result<Option<&str>, Error> {
+        self.getopt_str(curl_sys::CURLINFO_EFFECTIVE_URL)
+    }
+
+    /// Get the last used URL, in bytes
+    ///
+    /// In cases when you've asked libcurl to follow redirects, it may
+    /// not be the same value you set with `url`.
+    ///
+    /// This methods corresponds to the `CURLINFO_EFFECTIVE_URL` option.
+    ///
+    /// Returns `Ok(None)` if no effective url is listed or `Err` if an error
+    /// happens or the underlying bytes aren't valid utf-8.
+    pub fn effective_url_bytes(&self) -> Result<Option<&[u8]>, Error> {
+        self.getopt_bytes(curl_sys::CURLINFO_EFFECTIVE_URL)
+    }
+
+    /// Get the last response code
+    ///
+    /// The stored value will be zero if no server response code has been
+    /// received. Note that a proxy's CONNECT response should be read with
+    /// `http_connectcode` and not this.
+    ///
+    /// Corresponds to `CURLINFO_RESPONSE_CODE` and returns an error if this
+    /// option is not supported.
+    pub fn response_code(&self) -> Result<u32, Error> {
+        self.getopt_long(curl_sys::CURLINFO_RESPONSE_CODE)
+            .map(|c| c as u32)
+    }
+
+    /// Get the CONNECT response code
+    ///
+    /// Returns the last received HTTP proxy response code to a CONNECT request.
+    /// The returned value will be zero if no such response code was available.
+    ///
+    /// Corresponds to `CURLINFO_HTTP_CONNECTCODE` and returns an error if this
+    /// option is not supported.
+    pub fn http_connectcode(&self) -> Result<u32, Error> {
+        self.getopt_long(curl_sys::CURLINFO_HTTP_CONNECTCODE)
+            .map(|c| c as u32)
+    }
+
+    /// Get the remote time of the retrieved document
+    ///
+    /// Returns the remote time of the retrieved document (in number of seconds
+    /// since 1 Jan 1970 in the GMT/UTC time zone). If you get `None`, it can be
+    /// because of many reasons (it might be unknown, the server might hide it
+    /// or the server doesn't support the command that tells document time etc)
+    /// and the time of the document is unknown.
+    ///
+    /// Note that you must tell the server to collect this information before
+    /// the transfer is made, by using the `filetime` method to
+    /// or you will unconditionally get a `None` back.
+    ///
+    /// This corresponds to `CURLINFO_FILETIME` and may return an error if the
+    /// option is not supported
+    pub fn filetime(&self) -> Result<Option<i64>, Error> {
+        self.getopt_long(curl_sys::CURLINFO_FILETIME).map(|r| {
+            if r == -1 {
+                None
+            } else {
+                Some(r as i64)
+            }
+        })
+    }
+
+    /// Get the number of downloaded bytes
+    ///
+    /// Returns the total amount of bytes that were downloaded.
+    /// The amount is only for the latest transfer and will be reset again for each new transfer.
+    /// This counts actual payload data, what's also commonly called body.
+    /// All meta and header data are excluded and will not be counted in this number.
+    ///
+    /// This corresponds to `CURLINFO_SIZE_DOWNLOAD` and may return an error if the
+    /// option is not supported
+    pub fn download_size(&self) -> Result<f64, Error> {
+        self.getopt_double(curl_sys::CURLINFO_SIZE_DOWNLOAD)
+            .map(|r| r as f64)
+    }
+
+    /// Get the number of uploaded bytes
+    ///
+    /// Returns the total amount of bytes that were uploaded.
+    ///
+    /// This corresponds to `CURLINFO_SIZE_UPLOAD` and may return an error if the
+    /// option is not supported
+    pub fn upload_size(&self) -> Result<f64, Error> {
+        self.getopt_double(curl_sys::CURLINFO_SIZE_UPLOAD)
+            .map(|r| r as f64)
+    }
+
+    /// Get the content-length of the download
+    ///
+    /// Returns the content-length of the download.
+    /// This is the value read from the Content-Length: field
+    ///
+    /// This corresponds to `CURLINFO_CONTENT_LENGTH_DOWNLOAD` and may return an error if the
+    /// option is not supported
+    pub fn content_length_download(&self) -> Result<f64, Error> {
+        self.getopt_double(curl_sys::CURLINFO_CONTENT_LENGTH_DOWNLOAD)
+            .map(|r| r as f64)
+    }
+
+    /// Get total time of previous transfer
+    ///
+    /// Returns the total time for the previous transfer,
+    /// including name resolving, TCP connect etc.
+    ///
+    /// Corresponds to `CURLINFO_TOTAL_TIME` and may return an error if the
+    /// option isn't supported.
+    pub fn total_time(&self) -> Result<Duration, Error> {
+        self.getopt_double(curl_sys::CURLINFO_TOTAL_TIME)
+            .map(double_seconds_to_duration)
+    }
+
+    /// Get the name lookup time
+    ///
+    /// Returns the total time from the start
+    /// until the name resolving was completed.
+    ///
+    /// Corresponds to `CURLINFO_NAMELOOKUP_TIME` and may return an error if the
+    /// option isn't supported.
+    pub fn namelookup_time(&self) -> Result<Duration, Error> {
+        self.getopt_double(curl_sys::CURLINFO_NAMELOOKUP_TIME)
+            .map(double_seconds_to_duration)
+    }
+
+    /// Get the time until connect
+    ///
+    /// Returns the total time from the start
+    /// until the connection to the remote host (or proxy) was completed.
+    ///
+    /// Corresponds to `CURLINFO_CONNECT_TIME` and may return an error if the
+    /// option isn't supported.
+    pub fn connect_time(&self) -> Result<Duration, Error> {
+        self.getopt_double(curl_sys::CURLINFO_CONNECT_TIME)
+            .map(double_seconds_to_duration)
+    }
+
+    /// Get the time until the SSL/SSH handshake is completed
+    ///
+    /// Returns the total time it took from the start until the SSL/SSH
+    /// connect/handshake to the remote host was completed. This time is most often
+    /// very near to the `pretransfer_time` time, except for cases such as
+    /// HTTP pipelining where the pretransfer time can be delayed due to waits in
+    /// line for the pipeline and more.
+    ///
+    /// Corresponds to `CURLINFO_APPCONNECT_TIME` and may return an error if the
+    /// option isn't supported.
+    pub fn appconnect_time(&self) -> Result<Duration, Error> {
+        self.getopt_double(curl_sys::CURLINFO_APPCONNECT_TIME)
+            .map(double_seconds_to_duration)
+    }
+
+    /// Get the time until the file transfer start
+    ///
+    /// Returns the total time it took from the start until the file
+    /// transfer is just about to begin. This includes all pre-transfer commands
+    /// and negotiations that are specific to the particular protocol(s) involved.
+    /// It does not involve the sending of the protocol- specific request that
+    /// triggers a transfer.
+    ///
+    /// Corresponds to `CURLINFO_PRETRANSFER_TIME` and may return an error if the
+    /// option isn't supported.
+    pub fn pretransfer_time(&self) -> Result<Duration, Error> {
+        self.getopt_double(curl_sys::CURLINFO_PRETRANSFER_TIME)
+            .map(double_seconds_to_duration)
+    }
+
+    /// Get the time until the first byte is received
+    ///
+    /// Returns the total time it took from the start until the first
+    /// byte is received by libcurl. This includes `pretransfer_time` and
+    /// also the time the server needs to calculate the result.
+    ///
+    /// Corresponds to `CURLINFO_STARTTRANSFER_TIME` and may return an error if the
+    /// option isn't supported.
+    pub fn starttransfer_time(&self) -> Result<Duration, Error> {
+        self.getopt_double(curl_sys::CURLINFO_STARTTRANSFER_TIME)
+            .map(double_seconds_to_duration)
+    }
+
+    /// Get the time for all redirection steps
+    ///
+    /// Returns the total time it took for all redirection steps
+    /// include name lookup, connect, pretransfer and transfer before final
+    /// transaction was started. `redirect_time` contains the complete
+    /// execution time for multiple redirections.
+    ///
+    /// Corresponds to `CURLINFO_REDIRECT_TIME` and may return an error if the
+    /// option isn't supported.
+    pub fn redirect_time(&self) -> Result<Duration, Error> {
+        self.getopt_double(curl_sys::CURLINFO_REDIRECT_TIME)
+            .map(double_seconds_to_duration)
+    }
+
+    /// Get the number of redirects
+    ///
+    /// Corresponds to `CURLINFO_REDIRECT_COUNT` and may return an error if the
+    /// option isn't supported.
+    pub fn redirect_count(&self) -> Result<u32, Error> {
+        self.getopt_long(curl_sys::CURLINFO_REDIRECT_COUNT)
+            .map(|c| c as u32)
+    }
+
+    /// Get the URL a redirect would go to
+    ///
+    /// Returns the URL a redirect would take you to if you would enable
+    /// `follow_location`. This can come very handy if you think using the
+    /// built-in libcurl redirect logic isn't good enough for you but you would
+    /// still prefer to avoid implementing all the magic of figuring out the new
+    /// URL.
+    ///
+    /// Corresponds to `CURLINFO_REDIRECT_URL` and may return an error if the
+    /// url isn't valid utf-8 or an error happens.
+    pub fn redirect_url(&self) -> Result<Option<&str>, Error> {
+        self.getopt_str(curl_sys::CURLINFO_REDIRECT_URL)
+    }
+
+    /// Get the URL a redirect would go to, in bytes
+    ///
+    /// Returns the URL a redirect would take you to if you would enable
+    /// `follow_location`. This can come very handy if you think using the
+    /// built-in libcurl redirect logic isn't good enough for you but you would
+    /// still prefer to avoid implementing all the magic of figuring out the new
+    /// URL.
+    ///
+    /// Corresponds to `CURLINFO_REDIRECT_URL` and may return an error.
+    pub fn redirect_url_bytes(&self) -> Result<Option<&[u8]>, Error> {
+        self.getopt_bytes(curl_sys::CURLINFO_REDIRECT_URL)
+    }
+
+    /// Get size of retrieved headers
+    ///
+    /// Corresponds to `CURLINFO_HEADER_SIZE` and may return an error if the
+    /// option isn't supported.
+    pub fn header_size(&self) -> Result<u64, Error> {
+        self.getopt_long(curl_sys::CURLINFO_HEADER_SIZE)
+            .map(|c| c as u64)
+    }
+
+    /// Get size of sent request.
+    ///
+    /// Corresponds to `CURLINFO_REQUEST_SIZE` and may return an error if the
+    /// option isn't supported.
+    pub fn request_size(&self) -> Result<u64, Error> {
+        self.getopt_long(curl_sys::CURLINFO_REQUEST_SIZE)
+            .map(|c| c as u64)
+    }
+
+    /// Get Content-Type
+    ///
+    /// Returns the content-type of the downloaded object. This is the value
+    /// read from the Content-Type: field.  If you get `None`, it means that the
+    /// server didn't send a valid Content-Type header or that the protocol
+    /// used doesn't support this.
+    ///
+    /// Corresponds to `CURLINFO_CONTENT_TYPE` and may return an error if the
+    /// option isn't supported.
+    pub fn content_type(&self) -> Result<Option<&str>, Error> {
+        self.getopt_str(curl_sys::CURLINFO_CONTENT_TYPE)
+    }
+
+    /// Get Content-Type, in bytes
+    ///
+    /// Returns the content-type of the downloaded object. This is the value
+    /// read from the Content-Type: field.  If you get `None`, it means that the
+    /// server didn't send a valid Content-Type header or that the protocol
+    /// used doesn't support this.
+    ///
+    /// Corresponds to `CURLINFO_CONTENT_TYPE` and may return an error if the
+    /// option isn't supported.
+    pub fn content_type_bytes(&self) -> Result<Option<&[u8]>, Error> {
+        self.getopt_bytes(curl_sys::CURLINFO_CONTENT_TYPE)
+    }
+
+    /// Get errno number from last connect failure.
+    ///
+    /// Note that the value is only set on failure, it is not reset upon a
+    /// successful operation. The number is OS and system specific.
+    ///
+    /// Corresponds to `CURLINFO_OS_ERRNO` and may return an error if the
+    /// option isn't supported.
+    pub fn os_errno(&self) -> Result<i32, Error> {
+        self.getopt_long(curl_sys::CURLINFO_OS_ERRNO)
+            .map(|c| c as i32)
+    }
+
+    /// Get IP address of last connection.
+    ///
+    /// Returns a string holding the IP address of the most recent connection
+    /// done with this curl handle. This string may be IPv6 when that is
+    /// enabled.
+    ///
+    /// Corresponds to `CURLINFO_PRIMARY_IP` and may return an error if the
+    /// option isn't supported.
+    pub fn primary_ip(&self) -> Result<Option<&str>, Error> {
+        self.getopt_str(curl_sys::CURLINFO_PRIMARY_IP)
+    }
+
+    /// Get the latest destination port number
+    ///
+    /// Corresponds to `CURLINFO_PRIMARY_PORT` and may return an error if the
+    /// option isn't supported.
+    pub fn primary_port(&self) -> Result<u16, Error> {
+        self.getopt_long(curl_sys::CURLINFO_PRIMARY_PORT)
+            .map(|c| c as u16)
+    }
+
+    /// Get local IP address of last connection
+    ///
+    /// Returns a string holding the IP address of the local end of most recent
+    /// connection done with this curl handle. This string may be IPv6 when that
+    /// is enabled.
+    ///
+    /// Corresponds to `CURLINFO_LOCAL_IP` and may return an error if the
+    /// option isn't supported.
+    pub fn local_ip(&self) -> Result<Option<&str>, Error> {
+        self.getopt_str(curl_sys::CURLINFO_LOCAL_IP)
+    }
+
+    /// Get the latest local port number
+    ///
+    /// Corresponds to `CURLINFO_LOCAL_PORT` and may return an error if the
+    /// option isn't supported.
+    pub fn local_port(&self) -> Result<u16, Error> {
+        self.getopt_long(curl_sys::CURLINFO_LOCAL_PORT)
+            .map(|c| c as u16)
+    }
+
+    /// Get all known cookies
+    ///
+    /// Returns a linked-list of all cookies cURL knows (expired ones, too).
+    ///
+    /// Corresponds to the `CURLINFO_COOKIELIST` option and may return an error
+    /// if the option isn't supported.
+    pub fn cookies(&mut self) -> Result<List, Error> {
+        unsafe {
+            let mut list = ptr::null_mut();
+            let rc = curl_sys::curl_easy_getinfo(
+                self.inner.handle,
+                curl_sys::CURLINFO_COOKIELIST,
+                &mut list,
+            );
+            self.cvt(rc)?;
+            Ok(list::from_raw(list))
+        }
+    }
+
+    /// Wait for pipelining/multiplexing
+    ///
+    /// Set wait to `true` to tell libcurl to prefer to wait for a connection to
+    /// confirm or deny that it can do pipelining or multiplexing before
+    /// continuing.
+    ///
+    /// When about to perform a new transfer that allows pipelining or
+    /// multiplexing, libcurl will check for existing connections to re-use and
+    /// pipeline on. If no such connection exists it will immediately continue
+    /// and create a fresh new connection to use.
+    ///
+    /// By setting this option to `true` - and having `pipelining(true, true)`
+    /// enabled for the multi handle this transfer is associated with - libcurl
+    /// will instead wait for the connection to reveal if it is possible to
+    /// pipeline/multiplex on before it continues. This enables libcurl to much
+    /// better keep the number of connections to a minimum when using pipelining
+    /// or multiplexing protocols.
+    ///
+    /// The effect thus becomes that with this option set, libcurl prefers to
+    /// wait and re-use an existing connection for pipelining rather than the
+    /// opposite: prefer to open a new connection rather than waiting.
+    ///
+    /// The waiting time is as long as it takes for the connection to get up and
+    /// for libcurl to get the necessary response back that informs it about its
+    /// protocol and support level.
+    ///
+    /// This corresponds to the `CURLOPT_PIPEWAIT` option.
+    pub fn pipewait(&mut self, wait: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_PIPEWAIT, wait as c_long)
+    }
+
+    /// Allow HTTP/0.9 compliant responses
+    ///
+    /// Set allow to `true` to tell libcurl to allow HTTP/0.9 responses. A HTTP/0.9
+    /// response is a server response entirely without headers and only a body.
+    ///
+    /// By default this option is not set and corresponds to
+    /// `CURLOPT_HTTP09_ALLOWED`.
+    pub fn http_09_allowed(&mut self, allow: bool) -> Result<(), Error> {
+        self.setopt_long(curl_sys::CURLOPT_HTTP09_ALLOWED, allow as c_long)
+    }
+
+    // =========================================================================
+    // Other methods
+
+    /// After options have been set, this will perform the transfer described by
+    /// the options.
+    ///
+    /// This performs the request in a synchronous fashion. This can be used
+    /// multiple times for one easy handle and libcurl will attempt to re-use
+    /// the same connection for all transfers.
+    ///
+    /// This method will preserve all options configured in this handle for the
+    /// next request, and if that is not desired then the options can be
+    /// manually reset or the `reset` method can be called.
+    ///
+    /// Note that this method takes `&self`, which is quite important! This
+    /// allows applications to close over the handle in various callbacks to
+    /// call methods like `unpause_write` and `unpause_read` while a transfer is
+    /// in progress.
+    pub fn perform(&self) -> Result<(), Error> {
+        let ret = unsafe { self.cvt(curl_sys::curl_easy_perform(self.inner.handle)) };
+        panic::propagate();
+        ret
+    }
+
+    /// Some protocols have "connection upkeep" mechanisms. These mechanisms
+    /// usually send some traffic on existing connections in order to keep them
+    /// alive; this can prevent connections from being closed due to overzealous
+    /// firewalls, for example.
+    ///
+    /// Currently the only protocol with a connection upkeep mechanism is
+    /// HTTP/2: when the connection upkeep interval is exceeded and upkeep() is
+    /// called, an HTTP/2 PING frame is sent on the connection.
+    #[cfg(feature = "upkeep_7_62_0")]
+    pub fn upkeep(&self) -> Result<(), Error> {
+        let ret = unsafe { self.cvt(curl_sys::curl_easy_upkeep(self.inner.handle)) };
+        panic::propagate();
+        return ret;
+    }
+
+    /// Unpause reading on a connection.
+    ///
+    /// Using this function, you can explicitly unpause a connection that was
+    /// previously paused.
+    ///
+    /// A connection can be paused by letting the read or the write callbacks
+    /// return `ReadError::Pause` or `WriteError::Pause`.
+    ///
+    /// To unpause, you may for example call this from the progress callback
+    /// which gets called at least once per second, even if the connection is
+    /// paused.
+    ///
+    /// The chance is high that you will get your write callback called before
+    /// this function returns.
+    pub fn unpause_read(&self) -> Result<(), Error> {
+        unsafe {
+            let rc = curl_sys::curl_easy_pause(self.inner.handle, curl_sys::CURLPAUSE_RECV_CONT);
+            self.cvt(rc)
+        }
+    }
+
+    /// Unpause writing on a connection.
+    ///
+    /// Using this function, you can explicitly unpause a connection that was
+    /// previously paused.
+    ///
+    /// A connection can be paused by letting the read or the write callbacks
+    /// return `ReadError::Pause` or `WriteError::Pause`. A write callback that
+    /// returns pause signals to the library that it couldn't take care of any
+    /// data at all, and that data will then be delivered again to the callback
+    /// when the writing is later unpaused.
+    ///
+    /// To unpause, you may for example call this from the progress callback
+    /// which gets called at least once per second, even if the connection is
+    /// paused.
+    pub fn unpause_write(&self) -> Result<(), Error> {
+        unsafe {
+            let rc = curl_sys::curl_easy_pause(self.inner.handle, curl_sys::CURLPAUSE_SEND_CONT);
+            self.cvt(rc)
+        }
+    }
+
+    /// URL encodes a string `s`
+    pub fn url_encode(&mut self, s: &[u8]) -> String {
+        if s.is_empty() {
+            return String::new();
+        }
+        unsafe {
+            let p = curl_sys::curl_easy_escape(
+                self.inner.handle,
+                s.as_ptr() as *const _,
+                s.len() as c_int,
+            );
+            assert!(!p.is_null());
+            let ret = str::from_utf8(CStr::from_ptr(p).to_bytes()).unwrap();
+            let ret = String::from(ret);
+            curl_sys::curl_free(p as *mut _);
+            ret
+        }
+    }
+
+    /// URL decodes a string `s`, returning `None` if it fails
+    pub fn url_decode(&mut self, s: &str) -> Vec<u8> {
+        if s.is_empty() {
+            return Vec::new();
+        }
+
+        // Work around https://curl.haxx.se/docs/adv_20130622.html, a bug where
+        // if the last few characters are a bad escape then curl will have a
+        // buffer overrun.
+        let mut iter = s.chars().rev();
+        let orig_len = s.len();
+        let mut data;
+        let mut s = s;
+        if iter.next() == Some('%') || iter.next() == Some('%') || iter.next() == Some('%') {
+            data = s.to_string();
+            data.push(0u8 as char);
+            s = &data[..];
+        }
+        unsafe {
+            let mut len = 0;
+            let p = curl_sys::curl_easy_unescape(
+                self.inner.handle,
+                s.as_ptr() as *const _,
+                orig_len as c_int,
+                &mut len,
+            );
+            assert!(!p.is_null());
+            let slice = slice::from_raw_parts(p as *const u8, len as usize);
+            let ret = slice.to_vec();
+            curl_sys::curl_free(p as *mut _);
+            ret
+        }
+    }
+
+    // TODO: I don't think this is safe, you can drop this which has all the
+    //       callback data and then the next is use-after-free
+    //
+    // /// Attempts to clone this handle, returning a new session handle with the
+    // /// same options set for this handle.
+    // ///
+    // /// Internal state info and things like persistent connections ccannot be
+    // /// transferred.
+    // ///
+    // /// # Errors
+    // ///
+    // /// If a new handle could not be allocated or another error happens, `None`
+    // /// is returned.
+    // pub fn try_clone<'b>(&mut self) -> Option<Easy<'b>> {
+    //     unsafe {
+    //         let handle = curl_sys::curl_easy_duphandle(self.handle);
+    //         if handle.is_null() {
+    //             None
+    //         } else {
+    //             Some(Easy {
+    //                 handle: handle,
+    //                 data: blank_data(),
+    //                 _marker: marker::PhantomData,
+    //             })
+    //         }
+    //     }
+    // }
+
+    /// Receives data from a connected socket.
+    ///
+    /// Only useful after a successful `perform` with the `connect_only` option
+    /// set as well.
+    pub fn recv(&mut self, data: &mut [u8]) -> Result<usize, Error> {
+        unsafe {
+            let mut n = 0;
+            let r = curl_sys::curl_easy_recv(
+                self.inner.handle,
+                data.as_mut_ptr() as *mut _,
+                data.len(),
+                &mut n,
+            );
+            if r == curl_sys::CURLE_OK {
+                Ok(n)
+            } else {
+                Err(Error::new(r))
+            }
+        }
+    }
+
+    /// Sends data over the connected socket.
+    ///
+    /// Only useful after a successful `perform` with the `connect_only` option
+    /// set as well.
+    pub fn send(&mut self, data: &[u8]) -> Result<usize, Error> {
+        unsafe {
+            let mut n = 0;
+            let rc = curl_sys::curl_easy_send(
+                self.inner.handle,
+                data.as_ptr() as *const _,
+                data.len(),
+                &mut n,
+            );
+            self.cvt(rc)?;
+            Ok(n)
+        }
+    }
+
+    /// Get a pointer to the raw underlying CURL handle.
+    pub fn raw(&self) -> *mut curl_sys::CURL {
+        self.inner.handle
+    }
+
+    #[cfg(unix)]
+    fn setopt_path(&mut self, opt: curl_sys::CURLoption, val: &Path) -> Result<(), Error> {
+        use std::os::unix::prelude::*;
+        let s = CString::new(val.as_os_str().as_bytes())?;
+        self.setopt_str(opt, &s)
+    }
+
+    #[cfg(windows)]
+    fn setopt_path(&mut self, opt: curl_sys::CURLoption, val: &Path) -> Result<(), Error> {
+        match val.to_str() {
+            Some(s) => self.setopt_str(opt, &CString::new(s)?),
+            None => Err(Error::new(curl_sys::CURLE_CONV_FAILED)),
+        }
+    }
+
+    fn setopt_long(&mut self, opt: curl_sys::CURLoption, val: c_long) -> Result<(), Error> {
+        unsafe { self.cvt(curl_sys::curl_easy_setopt(self.inner.handle, opt, val)) }
+    }
+
+    fn setopt_str(&mut self, opt: curl_sys::CURLoption, val: &CStr) -> Result<(), Error> {
+        self.setopt_ptr(opt, val.as_ptr())
+    }
+
+    fn setopt_ptr(&self, opt: curl_sys::CURLoption, val: *const c_char) -> Result<(), Error> {
+        unsafe { self.cvt(curl_sys::curl_easy_setopt(self.inner.handle, opt, val)) }
+    }
+
+    fn setopt_off_t(
+        &mut self,
+        opt: curl_sys::CURLoption,
+        val: curl_sys::curl_off_t,
+    ) -> Result<(), Error> {
+        unsafe {
+            let rc = curl_sys::curl_easy_setopt(self.inner.handle, opt, val);
+            self.cvt(rc)
+        }
+    }
+
+    fn setopt_blob(&mut self, opt: curl_sys::CURLoption, val: &[u8]) -> Result<(), Error> {
+        let blob = curl_sys::curl_blob {
+            data: val.as_ptr() as *const c_void as *mut c_void,
+            len: val.len(),
+            flags: curl_sys::CURL_BLOB_COPY,
+        };
+        let blob_ptr = &blob as *const curl_sys::curl_blob;
+        unsafe { self.cvt(curl_sys::curl_easy_setopt(self.inner.handle, opt, blob_ptr)) }
+    }
+
+    fn getopt_bytes(&self, opt: curl_sys::CURLINFO) -> Result<Option<&[u8]>, Error> {
+        unsafe {
+            let p = self.getopt_ptr(opt)?;
+            if p.is_null() {
+                Ok(None)
+            } else {
+                Ok(Some(CStr::from_ptr(p).to_bytes()))
+            }
+        }
+    }
+
+    fn getopt_ptr(&self, opt: curl_sys::CURLINFO) -> Result<*const c_char, Error> {
+        unsafe {
+            let mut p = ptr::null();
+            let rc = curl_sys::curl_easy_getinfo(self.inner.handle, opt, &mut p);
+            self.cvt(rc)?;
+            Ok(p)
+        }
+    }
+
+    fn getopt_str(&self, opt: curl_sys::CURLINFO) -> Result<Option<&str>, Error> {
+        match self.getopt_bytes(opt) {
+            Ok(None) => Ok(None),
+            Err(e) => Err(e),
+            Ok(Some(bytes)) => match str::from_utf8(bytes) {
+                Ok(s) => Ok(Some(s)),
+                Err(_) => Err(Error::new(curl_sys::CURLE_CONV_FAILED)),
+            },
+        }
+    }
+
+    fn getopt_long(&self, opt: curl_sys::CURLINFO) -> Result<c_long, Error> {
+        unsafe {
+            let mut p = 0;
+            let rc = curl_sys::curl_easy_getinfo(self.inner.handle, opt, &mut p);
+            self.cvt(rc)?;
+            Ok(p)
+        }
+    }
+
+    fn getopt_double(&self, opt: curl_sys::CURLINFO) -> Result<c_double, Error> {
+        unsafe {
+            let mut p = 0 as c_double;
+            let rc = curl_sys::curl_easy_getinfo(self.inner.handle, opt, &mut p);
+            self.cvt(rc)?;
+            Ok(p)
+        }
+    }
+
+    /// Returns the contents of the internal error buffer, if available.
+    ///
+    /// When an easy handle is created it configured the `CURLOPT_ERRORBUFFER`
+    /// parameter and instructs libcurl to store more error information into a
+    /// buffer for better error messages and better debugging. The contents of
+    /// that buffer are automatically coupled with all errors for methods on
+    /// this type, but if manually invoking APIs the contents will need to be
+    /// extracted with this method.
+    ///
+    /// Put another way, you probably don't need this, you're probably already
+    /// getting nice error messages!
+    ///
+    /// This function will clear the internal buffer, so this is an operation
+    /// that mutates the handle internally.
+    pub fn take_error_buf(&self) -> Option<String> {
+        let mut buf = self.inner.error_buf.borrow_mut();
+        if buf[0] == 0 {
+            return None;
+        }
+        let pos = buf.iter().position(|i| *i == 0).unwrap_or(buf.len());
+        let msg = String::from_utf8_lossy(&buf[..pos]).into_owned();
+        buf[0] = 0;
+        Some(msg)
+    }
+
+    fn cvt(&self, rc: curl_sys::CURLcode) -> Result<(), Error> {
+        if rc == curl_sys::CURLE_OK {
+            return Ok(());
+        }
+        let mut err = Error::new(rc);
+        if let Some(msg) = self.take_error_buf() {
+            err.set_extra(msg);
+        }
+        Err(err)
+    }
+}
+
+impl<H: fmt::Debug> fmt::Debug for Easy2<H> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("Easy")
+            .field("handle", &self.inner.handle)
+            .field("handler", &self.inner.handler)
+            .finish()
+    }
+}
+
+impl<H> Drop for Easy2<H> {
+    fn drop(&mut self) {
+        unsafe {
+            curl_sys::curl_easy_cleanup(self.inner.handle);
+        }
+    }
+}
+
+extern "C" fn header_cb<H: Handler>(
+    buffer: *mut c_char,
+    size: size_t,
+    nitems: size_t,
+    userptr: *mut c_void,
+) -> size_t {
+    let keep_going = panic::catch(|| unsafe {
+        let data = slice::from_raw_parts(buffer as *const u8, size * nitems);
+        (*(userptr as *mut Inner<H>)).handler.header(data)
+    })
+    .unwrap_or(false);
+    if keep_going {
+        size * nitems
+    } else {
+        !0
+    }
+}
+
+extern "C" fn write_cb<H: Handler>(
+    ptr: *mut c_char,
+    size: size_t,
+    nmemb: size_t,
+    data: *mut c_void,
+) -> size_t {
+    panic::catch(|| unsafe {
+        let input = slice::from_raw_parts(ptr as *const u8, size * nmemb);
+        match (*(data as *mut Inner<H>)).handler.write(input) {
+            Ok(s) => s,
+            Err(WriteError::Pause) => curl_sys::CURL_WRITEFUNC_PAUSE,
+        }
+    })
+    .unwrap_or(!0)
+}
+
+extern "C" fn read_cb<H: Handler>(
+    ptr: *mut c_char,
+    size: size_t,
+    nmemb: size_t,
+    data: *mut c_void,
+) -> size_t {
+    panic::catch(|| unsafe {
+        let input = slice::from_raw_parts_mut(ptr as *mut u8, size * nmemb);
+        match (*(data as *mut Inner<H>)).handler.read(input) {
+            Ok(s) => s,
+            Err(ReadError::Pause) => curl_sys::CURL_READFUNC_PAUSE,
+            Err(ReadError::Abort) => curl_sys::CURL_READFUNC_ABORT,
+        }
+    })
+    .unwrap_or(!0)
+}
+
+extern "C" fn seek_cb<H: Handler>(
+    data: *mut c_void,
+    offset: curl_sys::curl_off_t,
+    origin: c_int,
+) -> c_int {
+    panic::catch(|| unsafe {
+        let from = if origin == libc::SEEK_SET {
+            SeekFrom::Start(offset as u64)
+        } else {
+            panic!("unknown origin from libcurl: {}", origin);
+        };
+        (*(data as *mut Inner<H>)).handler.seek(from) as c_int
+    })
+    .unwrap_or(!0)
+}
+
+extern "C" fn progress_cb<H: Handler>(
+    data: *mut c_void,
+    dltotal: c_double,
+    dlnow: c_double,
+    ultotal: c_double,
+    ulnow: c_double,
+) -> c_int {
+    let keep_going = panic::catch(|| unsafe {
+        (*(data as *mut Inner<H>))
+            .handler
+            .progress(dltotal, dlnow, ultotal, ulnow)
+    })
+    .unwrap_or(false);
+    if keep_going {
+        0
+    } else {
+        1
+    }
+}
+
+// TODO: expose `handle`? is that safe?
+extern "C" fn debug_cb<H: Handler>(
+    _handle: *mut curl_sys::CURL,
+    kind: curl_sys::curl_infotype,
+    data: *mut c_char,
+    size: size_t,
+    userptr: *mut c_void,
+) -> c_int {
+    panic::catch(|| unsafe {
+        let data = slice::from_raw_parts(data as *const u8, size);
+        let kind = match kind {
+            curl_sys::CURLINFO_TEXT => InfoType::Text,
+            curl_sys::CURLINFO_HEADER_IN => InfoType::HeaderIn,
+            curl_sys::CURLINFO_HEADER_OUT => InfoType::HeaderOut,
+            curl_sys::CURLINFO_DATA_IN => InfoType::DataIn,
+            curl_sys::CURLINFO_DATA_OUT => InfoType::DataOut,
+            curl_sys::CURLINFO_SSL_DATA_IN => InfoType::SslDataIn,
+            curl_sys::CURLINFO_SSL_DATA_OUT => InfoType::SslDataOut,
+            _ => return,
+        };
+        (*(userptr as *mut Inner<H>)).handler.debug(kind, data)
+    });
+    0
+}
+
+extern "C" fn ssl_ctx_cb<H: Handler>(
+    _handle: *mut curl_sys::CURL,
+    ssl_ctx: *mut c_void,
+    data: *mut c_void,
+) -> curl_sys::CURLcode {
+    let res = panic::catch(|| unsafe {
+        match (*(data as *mut Inner<H>)).handler.ssl_ctx(ssl_ctx) {
+            Ok(()) => curl_sys::CURLE_OK,
+            Err(e) => e.code(),
+        }
+    });
+    // Default to a generic SSL error in case of panic. This
+    // shouldn't really matter since the error should be
+    // propagated later on but better safe than sorry...
+    res.unwrap_or(curl_sys::CURLE_SSL_CONNECT_ERROR)
+}
+
+// TODO: expose `purpose` and `sockaddr` inside of `address`
+extern "C" fn opensocket_cb<H: Handler>(
+    data: *mut c_void,
+    _purpose: curl_sys::curlsocktype,
+    address: *mut curl_sys::curl_sockaddr,
+) -> curl_sys::curl_socket_t {
+    let res = panic::catch(|| unsafe {
+        (*(data as *mut Inner<H>))
+            .handler
+            .open_socket((*address).family, (*address).socktype, (*address).protocol)
+            .unwrap_or(curl_sys::CURL_SOCKET_BAD)
+    });
+    res.unwrap_or(curl_sys::CURL_SOCKET_BAD)
+}
+
+fn double_seconds_to_duration(seconds: f64) -> Duration {
+    let whole_seconds = seconds.trunc() as u64;
+    let nanos = seconds.fract() * 1_000_000_000f64;
+    Duration::new(whole_seconds, nanos as u32)
+}
+
+#[test]
+fn double_seconds_to_duration_whole_second() {
+    let dur = double_seconds_to_duration(1.0);
+    assert_eq!(dur.as_secs(), 1);
+    assert_eq!(dur.subsec_nanos(), 0);
+}
+
+#[test]
+fn double_seconds_to_duration_sub_second1() {
+    let dur = double_seconds_to_duration(0.0);
+    assert_eq!(dur.as_secs(), 0);
+    assert_eq!(dur.subsec_nanos(), 0);
+}
+
+#[test]
+fn double_seconds_to_duration_sub_second2() {
+    let dur = double_seconds_to_duration(0.5);
+    assert_eq!(dur.as_secs(), 0);
+    assert_eq!(dur.subsec_nanos(), 500_000_000);
+}
+
+impl Auth {
+    /// Creates a new set of authentications with no members.
+    ///
+    /// An `Auth` structure is used to configure which forms of authentication
+    /// are attempted when negotiating connections with servers.
+    pub fn new() -> Auth {
+        Auth { bits: 0 }
+    }
+
+    /// HTTP Basic authentication.
+    ///
+    /// This is the default choice, and the only method that is in wide-spread
+    /// use and supported virtually everywhere.  This sends the user name and
+    /// password over the network in plain text, easily captured by others.
+    pub fn basic(&mut self, on: bool) -> &mut Auth {
+        self.flag(curl_sys::CURLAUTH_BASIC, on)
+    }
+
+    /// HTTP Digest authentication.
+    ///
+    /// Digest authentication is defined in RFC 2617 and is a more secure way to
+    /// do authentication over public networks than the regular old-fashioned
+    /// Basic method.
+    pub fn digest(&mut self, on: bool) -> &mut Auth {
+        self.flag(curl_sys::CURLAUTH_DIGEST, on)
+    }
+
+    /// HTTP Digest authentication with an IE flavor.
+    ///
+    /// Digest authentication is defined in RFC 2617 and is a more secure way to
+    /// do authentication over public networks than the regular old-fashioned
+    /// Basic method. The IE flavor is simply that libcurl will use a special
+    /// "quirk" that IE is known to have used before version 7 and that some
+    /// servers require the client to use.
+    pub fn digest_ie(&mut self, on: bool) -> &mut Auth {
+        self.flag(curl_sys::CURLAUTH_DIGEST_IE, on)
+    }
+
+    /// HTTP Negotiate (SPNEGO) authentication.
+    ///
+    /// Negotiate authentication is defined in RFC 4559 and is the most secure
+    /// way to perform authentication over HTTP.
+    ///
+    /// You need to build libcurl with a suitable GSS-API library or SSPI on
+    /// Windows for this to work.
+    pub fn gssnegotiate(&mut self, on: bool) -> &mut Auth {
+        self.flag(curl_sys::CURLAUTH_GSSNEGOTIATE, on)
+    }
+
+    /// HTTP NTLM authentication.
+    ///
+    /// A proprietary protocol invented and used by Microsoft. It uses a
+    /// challenge-response and hash concept similar to Digest, to prevent the
+    /// password from being eavesdropped.
+    ///
+    /// You need to build libcurl with either OpenSSL, GnuTLS or NSS support for
+    /// this option to work, or build libcurl on Windows with SSPI support.
+    pub fn ntlm(&mut self, on: bool) -> &mut Auth {
+        self.flag(curl_sys::CURLAUTH_NTLM, on)
+    }
+
+    /// NTLM delegating to winbind helper.
+    ///
+    /// Authentication is performed by a separate binary application that is
+    /// executed when needed. The name of the application is specified at
+    /// compile time but is typically /usr/bin/ntlm_auth
+    ///
+    /// Note that libcurl will fork when necessary to run the winbind
+    /// application and kill it when complete, calling waitpid() to await its
+    /// exit when done. On POSIX operating systems, killing the process will
+    /// cause a SIGCHLD signal to be raised (regardless of whether
+    /// CURLOPT_NOSIGNAL is set), which must be handled intelligently by the
+    /// application. In particular, the application must not unconditionally
+    /// call wait() in its SIGCHLD signal handler to avoid being subject to a
+    /// race condition. This behavior is subject to change in future versions of
+    /// libcurl.
+    ///
+    /// A proprietary protocol invented and used by Microsoft. It uses a
+    /// challenge-response and hash concept similar to Digest, to prevent the
+    /// password from being eavesdropped.
+    pub fn ntlm_wb(&mut self, on: bool) -> &mut Auth {
+        self.flag(curl_sys::CURLAUTH_NTLM_WB, on)
+    }
+
+    /// HTTP AWS V4 signature authentication.
+    ///
+    /// This is a special auth type that can't be combined with the others.
+    /// It will override the other auth types you might have set.
+    ///
+    /// Enabling this auth type is the same as using "aws:amz" as param in
+    /// [`Easy2::aws_sigv4`](struct.Easy2.html#method.aws_sigv4) method.
+    pub fn aws_sigv4(&mut self, on: bool) -> &mut Auth {
+        self.flag(curl_sys::CURLAUTH_AWS_SIGV4, on)
+    }
+
+    /// HTTP Auto authentication.
+    ///
+    /// This is a combination for CURLAUTH_BASIC | CURLAUTH_DIGEST |
+    /// CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM
+    pub fn auto(&mut self, on: bool) -> &mut Auth {
+        self.flag(curl_sys::CURLAUTH_ANY, on)
+    }
+
+    fn flag(&mut self, bit: c_ulong, on: bool) -> &mut Auth {
+        if on {
+            self.bits |= bit as c_long;
+        } else {
+            self.bits &= !bit as c_long;
+        }
+        self
+    }
+}
+
+impl fmt::Debug for Auth {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let bits = self.bits as c_ulong;
+        f.debug_struct("Auth")
+            .field("basic", &(bits & curl_sys::CURLAUTH_BASIC != 0))
+            .field("digest", &(bits & curl_sys::CURLAUTH_DIGEST != 0))
+            .field("digest_ie", &(bits & curl_sys::CURLAUTH_DIGEST_IE != 0))
+            .field(
+                "gssnegotiate",
+                &(bits & curl_sys::CURLAUTH_GSSNEGOTIATE != 0),
+            )
+            .field("ntlm", &(bits & curl_sys::CURLAUTH_NTLM != 0))
+            .field("ntlm_wb", &(bits & curl_sys::CURLAUTH_NTLM_WB != 0))
+            .field("aws_sigv4", &(bits & curl_sys::CURLAUTH_AWS_SIGV4 != 0))
+            .finish()
+    }
+}
+
+impl SslOpt {
+    /// Creates a new set of SSL options.
+    pub fn new() -> SslOpt {
+        SslOpt { bits: 0 }
+    }
+
+    /// Tell libcurl to automatically locate and use a client certificate for authentication,
+    /// when requested by the server.
+    ///
+    /// This option is only supported for Schannel (the native Windows SSL library).
+    /// Prior to 7.77.0 this was the default behavior in libcurl with Schannel.
+    ///
+    /// Since the server can request any certificate that supports client authentication in
+    /// the OS certificate store it could be a privacy violation and unexpected. (Added in 7.77.0)
+    pub fn auto_client_cert(&mut self, on: bool) -> &mut SslOpt {
+        self.flag(curl_sys::CURLSSLOPT_AUTO_CLIENT_CERT, on)
+    }
+
+    /// Tell libcurl to use the operating system's native CA store for certificate verification.
+    ///
+    /// Works only on Windows when built to use OpenSSL.
+    ///
+    /// This option is experimental and behavior is subject to change. (Added in 7.71.0)
+    pub fn native_ca(&mut self, on: bool) -> &mut SslOpt {
+        self.flag(curl_sys::CURLSSLOPT_NATIVE_CA, on)
+    }
+
+    /// Tells libcurl to ignore certificate revocation checks in case of missing or
+    /// offline distribution points for those SSL backends where such behavior is present.
+    ///
+    /// This option is only supported for Schannel (the native Windows SSL library).
+    ///
+    /// If combined with CURLSSLOPT_NO_REVOKE, the latter takes precedence. (Added in 7.70.0)
+    pub fn revoke_best_effort(&mut self, on: bool) -> &mut SslOpt {
+        self.flag(curl_sys::CURLSSLOPT_REVOKE_BEST_EFFORT, on)
+    }
+
+    /// Tells libcurl to not accept "partial" certificate chains, which it otherwise does by default.
+    ///
+    /// This option is only supported for OpenSSL and will fail the certificate verification
+    /// if the chain ends with an intermediate certificate and not with a root cert.
+    /// (Added in 7.68.0)
+    pub fn no_partial_chain(&mut self, on: bool) -> &mut SslOpt {
+        self.flag(curl_sys::CURLSSLOPT_NO_PARTIALCHAIN, on)
+    }
+
+    /// Tells libcurl to disable certificate revocation checks for those SSL
+    /// backends where such behavior is present.
+    ///
+    /// Currently this option is only supported for WinSSL (the native Windows
+    /// SSL library), with an exception in the case of Windows' Untrusted
+    /// Publishers blacklist which it seems can't be bypassed. This option may
+    /// have broader support to accommodate other SSL backends in the future.
+    /// <https://curl.haxx.se/docs/ssl-compared.html>
+    pub fn no_revoke(&mut self, on: bool) -> &mut SslOpt {
+        self.flag(curl_sys::CURLSSLOPT_NO_REVOKE, on)
+    }
+
+    /// Tells libcurl to not attempt to use any workarounds for a security flaw
+    /// in the SSL3 and TLS1.0 protocols.
+    ///
+    /// If this option isn't used or this bit is set to 0, the SSL layer libcurl
+    /// uses may use a work-around for this flaw although it might cause
+    /// interoperability problems with some (older) SSL implementations.
+    ///
+    /// > WARNING: avoiding this work-around lessens the security, and by
+    /// > setting this option to 1 you ask for exactly that. This option is only
+    /// > supported for DarwinSSL, NSS and OpenSSL.
+    pub fn allow_beast(&mut self, on: bool) -> &mut SslOpt {
+        self.flag(curl_sys::CURLSSLOPT_ALLOW_BEAST, on)
+    }
+
+    fn flag(&mut self, bit: c_long, on: bool) -> &mut SslOpt {
+        if on {
+            self.bits |= bit as c_long;
+        } else {
+            self.bits &= !bit as c_long;
+        }
+        self
+    }
+}
+
+impl fmt::Debug for SslOpt {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("SslOpt")
+            .field(
+                "no_revoke",
+                &(self.bits & curl_sys::CURLSSLOPT_NO_REVOKE != 0),
+            )
+            .field(
+                "allow_beast",
+                &(self.bits & curl_sys::CURLSSLOPT_ALLOW_BEAST != 0),
+            )
+            .finish()
+    }
+}
+
+impl PostRedirections {
+    /// Create an empty PostRedirection setting with no flags set.
+    pub fn new() -> PostRedirections {
+        PostRedirections { bits: 0 }
+    }
+
+    /// Configure POST method behaviour on a 301 redirect. Setting the value
+    /// to true will preserve the method when following the redirect, else
+    /// the method is changed to GET.
+    pub fn redirect_301(&mut self, on: bool) -> &mut PostRedirections {
+        self.flag(curl_sys::CURL_REDIR_POST_301, on)
+    }
+
+    /// Configure POST method behaviour on a 302 redirect. Setting the value
+    /// to true will preserve the method when following the redirect, else
+    /// the method is changed to GET.
+    pub fn redirect_302(&mut self, on: bool) -> &mut PostRedirections {
+        self.flag(curl_sys::CURL_REDIR_POST_302, on)
+    }
+
+    /// Configure POST method behaviour on a 303 redirect. Setting the value
+    /// to true will preserve the method when following the redirect, else
+    /// the method is changed to GET.
+    pub fn redirect_303(&mut self, on: bool) -> &mut PostRedirections {
+        self.flag(curl_sys::CURL_REDIR_POST_303, on)
+    }
+
+    /// Configure POST method behaviour for all redirects. Setting the value
+    /// to true will preserve the method when following the redirect, else
+    /// the method is changed to GET.
+    pub fn redirect_all(&mut self, on: bool) -> &mut PostRedirections {
+        self.flag(curl_sys::CURL_REDIR_POST_ALL, on)
+    }
+
+    fn flag(&mut self, bit: c_ulong, on: bool) -> &mut PostRedirections {
+        if on {
+            self.bits |= bit;
+        } else {
+            self.bits &= !bit;
+        }
+        self
+    }
+}
+
+impl fmt::Debug for PostRedirections {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("PostRedirections")
+            .field(
+                "redirect_301",
+                &(self.bits & curl_sys::CURL_REDIR_POST_301 != 0),
+            )
+            .field(
+                "redirect_302",
+                &(self.bits & curl_sys::CURL_REDIR_POST_302 != 0),
+            )
+            .field(
+                "redirect_303",
+                &(self.bits & curl_sys::CURL_REDIR_POST_303 != 0),
+            )
+            .finish()
+    }
+}
+
\ No newline at end of file diff --git a/src/curl/easy/list.rs.html b/src/curl/easy/list.rs.html new file mode 100644 index 000000000..e702ad3db --- /dev/null +++ b/src/curl/easy/list.rs.html @@ -0,0 +1,208 @@ +list.rs - source +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+
use std::ffi::{CStr, CString};
+use std::fmt;
+use std::ptr;
+
+use crate::Error;
+use curl_sys;
+
+/// A linked list of a strings
+pub struct List {
+    raw: *mut curl_sys::curl_slist,
+}
+
+/// An iterator over `List`
+#[derive(Clone)]
+pub struct Iter<'a> {
+    _me: &'a List,
+    cur: *mut curl_sys::curl_slist,
+}
+
+pub fn raw(list: &List) -> *mut curl_sys::curl_slist {
+    list.raw
+}
+
+pub unsafe fn from_raw(raw: *mut curl_sys::curl_slist) -> List {
+    List { raw }
+}
+
+unsafe impl Send for List {}
+
+impl List {
+    /// Creates a new empty list of strings.
+    pub fn new() -> List {
+        List {
+            raw: ptr::null_mut(),
+        }
+    }
+
+    /// Appends some data into this list.
+    pub fn append(&mut self, data: &str) -> Result<(), Error> {
+        let data = CString::new(data)?;
+        unsafe {
+            let raw = curl_sys::curl_slist_append(self.raw, data.as_ptr());
+            assert!(!raw.is_null());
+            self.raw = raw;
+            Ok(())
+        }
+    }
+
+    /// Returns an iterator over the nodes in this list.
+    pub fn iter(&self) -> Iter {
+        Iter {
+            _me: self,
+            cur: self.raw,
+        }
+    }
+}
+
+impl fmt::Debug for List {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_list()
+            .entries(self.iter().map(String::from_utf8_lossy))
+            .finish()
+    }
+}
+
+impl<'a> IntoIterator for &'a List {
+    type IntoIter = Iter<'a>;
+    type Item = &'a [u8];
+
+    fn into_iter(self) -> Iter<'a> {
+        self.iter()
+    }
+}
+
+impl Drop for List {
+    fn drop(&mut self) {
+        unsafe { curl_sys::curl_slist_free_all(self.raw) }
+    }
+}
+
+impl<'a> Iterator for Iter<'a> {
+    type Item = &'a [u8];
+
+    fn next(&mut self) -> Option<&'a [u8]> {
+        if self.cur.is_null() {
+            return None;
+        }
+
+        unsafe {
+            let ret = Some(CStr::from_ptr((*self.cur).data).to_bytes());
+            self.cur = (*self.cur).next;
+            ret
+        }
+    }
+}
+
+impl<'a> fmt::Debug for Iter<'a> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_list()
+            .entries(self.clone().map(String::from_utf8_lossy))
+            .finish()
+    }
+}
+
\ No newline at end of file diff --git a/src/curl/easy/mod.rs.html b/src/curl/easy/mod.rs.html new file mode 100644 index 000000000..f6c238bf8 --- /dev/null +++ b/src/curl/easy/mod.rs.html @@ -0,0 +1,46 @@ +mod.rs - source +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
//! Bindings to the "easy" libcurl API.
+//!
+//! This module contains some simple types like `Easy` and `List` which are just
+//! wrappers around the corresponding libcurl types. There's also a few enums
+//! scattered about for various options here and there.
+//!
+//! Most simple usage of libcurl will likely use the `Easy` structure here, and
+//! you can find more docs about its usage on that struct.
+
+mod form;
+mod handle;
+mod handler;
+mod list;
+mod windows;
+
+pub use self::form::{Form, Part};
+pub use self::handle::{Easy, Transfer};
+pub use self::handler::{Auth, NetRc, PostRedirections, ProxyType, SslOpt};
+pub use self::handler::{Easy2, Handler};
+pub use self::handler::{HttpVersion, IpResolve, SslVersion, TimeCondition};
+pub use self::handler::{InfoType, ReadError, SeekResult, WriteError};
+pub use self::list::{Iter, List};
+
\ No newline at end of file diff --git a/src/curl/easy/windows.rs.html b/src/curl/easy/windows.rs.html new file mode 100644 index 000000000..1c1513c86 --- /dev/null +++ b/src/curl/easy/windows.rs.html @@ -0,0 +1,256 @@ +windows.rs - source +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+
#![allow(non_camel_case_types, non_snake_case)]
+
+use libc::c_void;
+
+#[cfg(target_env = "msvc")]
+mod win {
+    use schannel::cert_context::ValidUses;
+    use schannel::cert_store::CertStore;
+    use std::ffi::*;
+    use std::mem;
+    use std::ptr;
+    use windows_sys::Win32::Security::Cryptography::*;
+    use windows_sys::Win32::System::LibraryLoader::*;
+
+    fn lookup(module: &str, symbol: &str) -> Option<*const c_void> {
+        unsafe {
+            let mut mod_buf: Vec<u16> = module.encode_utf16().collect();
+            mod_buf.push(0);
+            let handle = GetModuleHandleW(mod_buf.as_mut_ptr());
+            GetProcAddress(handle, symbol.as_ptr()).map(|n| n as *const c_void)
+        }
+    }
+
+    pub enum X509_STORE {}
+    pub enum X509 {}
+    pub enum SSL_CTX {}
+
+    type d2i_X509_fn = unsafe extern "C" fn(
+        a: *mut *mut X509,
+        pp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut X509;
+    type X509_free_fn = unsafe extern "C" fn(x: *mut X509);
+    type X509_STORE_add_cert_fn =
+        unsafe extern "C" fn(store: *mut X509_STORE, x: *mut X509) -> c_int;
+    type SSL_CTX_get_cert_store_fn = unsafe extern "C" fn(ctx: *const SSL_CTX) -> *mut X509_STORE;
+
+    struct OpenSSL {
+        d2i_X509: d2i_X509_fn,
+        X509_free: X509_free_fn,
+        X509_STORE_add_cert: X509_STORE_add_cert_fn,
+        SSL_CTX_get_cert_store: SSL_CTX_get_cert_store_fn,
+    }
+
+    unsafe fn lookup_functions(crypto_module: &str, ssl_module: &str) -> Option<OpenSSL> {
+        macro_rules! get {
+            ($(let $sym:ident in $module:expr;)*) => ($(
+                let $sym = match lookup($module, stringify!($sym)) {
+                    Some(p) => p,
+                    None => return None,
+                };
+            )*)
+        }
+        get! {
+            let d2i_X509 in crypto_module;
+            let X509_free in crypto_module;
+            let X509_STORE_add_cert in crypto_module;
+            let SSL_CTX_get_cert_store in ssl_module;
+        }
+        Some(OpenSSL {
+            d2i_X509: mem::transmute(d2i_X509),
+            X509_free: mem::transmute(X509_free),
+            X509_STORE_add_cert: mem::transmute(X509_STORE_add_cert),
+            SSL_CTX_get_cert_store: mem::transmute(SSL_CTX_get_cert_store),
+        })
+    }
+
+    pub unsafe fn add_certs_to_context(ssl_ctx: *mut c_void) {
+        // check the runtime version of OpenSSL
+        let openssl = match crate::version::Version::get().ssl_version() {
+            Some(ssl_ver) if ssl_ver.starts_with("OpenSSL/1.1.0") => {
+                lookup_functions("libcrypto", "libssl")
+            }
+            Some(ssl_ver) if ssl_ver.starts_with("OpenSSL/1.0.2") => {
+                lookup_functions("libeay32", "ssleay32")
+            }
+            _ => return,
+        };
+        let openssl = match openssl {
+            Some(s) => s,
+            None => return,
+        };
+
+        let openssl_store = (openssl.SSL_CTX_get_cert_store)(ssl_ctx as *const SSL_CTX);
+        let store = match CertStore::open_current_user("ROOT") {
+            Ok(s) => s,
+            Err(_) => return,
+        };
+
+        for cert in store.certs() {
+            let valid_uses = match cert.valid_uses() {
+                Ok(v) => v,
+                Err(_) => continue,
+            };
+
+            // check the extended key usage for the "Server Authentication" OID
+            match valid_uses {
+                ValidUses::All => {}
+                ValidUses::Oids(ref oids) => {
+                    let oid = CStr::from_ptr(szOID_PKIX_KP_SERVER_AUTH as *const _)
+                        .to_string_lossy()
+                        .into_owned();
+                    if !oids.contains(&oid) {
+                        continue;
+                    }
+                }
+            }
+
+            let der = cert.to_der();
+            let x509 = (openssl.d2i_X509)(ptr::null_mut(), &mut der.as_ptr(), der.len() as c_long);
+            if !x509.is_null() {
+                (openssl.X509_STORE_add_cert)(openssl_store, x509);
+                (openssl.X509_free)(x509);
+            }
+        }
+    }
+}
+
+#[cfg(target_env = "msvc")]
+pub fn add_certs_to_context(ssl_ctx: *mut c_void) {
+    unsafe {
+        win::add_certs_to_context(ssl_ctx as *mut _);
+    }
+}
+
+#[cfg(not(target_env = "msvc"))]
+pub fn add_certs_to_context(_: *mut c_void) {}
+
\ No newline at end of file diff --git a/src/curl/error.rs.html b/src/curl/error.rs.html new file mode 100644 index 000000000..0e79f1d08 --- /dev/null +++ b/src/curl/error.rs.html @@ -0,0 +1,1236 @@ +error.rs - source +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+
use std::error;
+use std::ffi::{self, CStr};
+use std::fmt;
+use std::io;
+use std::str;
+
+/// An error returned from various "easy" operations.
+///
+/// This structure wraps a `CURLcode`.
+#[derive(Clone, PartialEq)]
+pub struct Error {
+    code: curl_sys::CURLcode,
+    extra: Option<Box<str>>,
+}
+
+impl Error {
+    /// Creates a new error from the underlying code returned by libcurl.
+    pub fn new(code: curl_sys::CURLcode) -> Error {
+        Error { code, extra: None }
+    }
+
+    /// 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 set_extra(&mut self, extra: String) {
+        self.extra = Some(extra.into());
+    }
+
+    /// Returns whether this error corresponds to CURLE_UNSUPPORTED_PROTOCOL.
+    pub fn is_unsupported_protocol(&self) -> bool {
+        self.code == curl_sys::CURLE_UNSUPPORTED_PROTOCOL
+    }
+
+    /// Returns whether this error corresponds to CURLE_FAILED_INIT.
+    pub fn is_failed_init(&self) -> bool {
+        self.code == curl_sys::CURLE_FAILED_INIT
+    }
+
+    /// Returns whether this error corresponds to CURLE_URL_MALFORMAT.
+    pub fn is_url_malformed(&self) -> bool {
+        self.code == curl_sys::CURLE_URL_MALFORMAT
+    }
+
+    // /// Returns whether this error corresponds to CURLE_NOT_BUILT_IN.
+    // pub fn is_not_built_in(&self) -> bool {
+    //     self.code == curl_sys::CURLE_NOT_BUILT_IN
+    // }
+
+    /// Returns whether this error corresponds to CURLE_COULDNT_RESOLVE_PROXY.
+    pub fn is_couldnt_resolve_proxy(&self) -> bool {
+        self.code == curl_sys::CURLE_COULDNT_RESOLVE_PROXY
+    }
+
+    /// Returns whether this error corresponds to CURLE_COULDNT_RESOLVE_HOST.
+    pub fn is_couldnt_resolve_host(&self) -> bool {
+        self.code == curl_sys::CURLE_COULDNT_RESOLVE_HOST
+    }
+
+    /// Returns whether this error corresponds to CURLE_COULDNT_CONNECT.
+    pub fn is_couldnt_connect(&self) -> bool {
+        self.code == curl_sys::CURLE_COULDNT_CONNECT
+    }
+
+    /// Returns whether this error corresponds to CURLE_REMOTE_ACCESS_DENIED.
+    pub fn is_remote_access_denied(&self) -> bool {
+        self.code == curl_sys::CURLE_REMOTE_ACCESS_DENIED
+    }
+
+    /// Returns whether this error corresponds to CURLE_PARTIAL_FILE.
+    pub fn is_partial_file(&self) -> bool {
+        self.code == curl_sys::CURLE_PARTIAL_FILE
+    }
+
+    /// Returns whether this error corresponds to CURLE_QUOTE_ERROR.
+    pub fn is_quote_error(&self) -> bool {
+        self.code == curl_sys::CURLE_QUOTE_ERROR
+    }
+
+    /// Returns whether this error corresponds to CURLE_HTTP_RETURNED_ERROR.
+    pub fn is_http_returned_error(&self) -> bool {
+        self.code == curl_sys::CURLE_HTTP_RETURNED_ERROR
+    }
+
+    /// Returns whether this error corresponds to CURLE_READ_ERROR.
+    pub fn is_read_error(&self) -> bool {
+        self.code == curl_sys::CURLE_READ_ERROR
+    }
+
+    /// Returns whether this error corresponds to CURLE_WRITE_ERROR.
+    pub fn is_write_error(&self) -> bool {
+        self.code == curl_sys::CURLE_WRITE_ERROR
+    }
+
+    /// Returns whether this error corresponds to CURLE_UPLOAD_FAILED.
+    pub fn is_upload_failed(&self) -> bool {
+        self.code == curl_sys::CURLE_UPLOAD_FAILED
+    }
+
+    /// Returns whether this error corresponds to CURLE_OUT_OF_MEMORY.
+    pub fn is_out_of_memory(&self) -> bool {
+        self.code == curl_sys::CURLE_OUT_OF_MEMORY
+    }
+
+    /// Returns whether this error corresponds to CURLE_OPERATION_TIMEDOUT.
+    pub fn is_operation_timedout(&self) -> bool {
+        self.code == curl_sys::CURLE_OPERATION_TIMEDOUT
+    }
+
+    /// Returns whether this error corresponds to CURLE_RANGE_ERROR.
+    pub fn is_range_error(&self) -> bool {
+        self.code == curl_sys::CURLE_RANGE_ERROR
+    }
+
+    /// Returns whether this error corresponds to CURLE_HTTP_POST_ERROR.
+    pub fn is_http_post_error(&self) -> bool {
+        self.code == curl_sys::CURLE_HTTP_POST_ERROR
+    }
+
+    /// Returns whether this error corresponds to CURLE_SSL_CONNECT_ERROR.
+    pub fn is_ssl_connect_error(&self) -> bool {
+        self.code == curl_sys::CURLE_SSL_CONNECT_ERROR
+    }
+
+    /// Returns whether this error corresponds to CURLE_BAD_DOWNLOAD_RESUME.
+    pub fn is_bad_download_resume(&self) -> bool {
+        self.code == curl_sys::CURLE_BAD_DOWNLOAD_RESUME
+    }
+
+    /// Returns whether this error corresponds to CURLE_FILE_COULDNT_READ_FILE.
+    pub fn is_file_couldnt_read_file(&self) -> bool {
+        self.code == curl_sys::CURLE_FILE_COULDNT_READ_FILE
+    }
+
+    /// Returns whether this error corresponds to CURLE_FUNCTION_NOT_FOUND.
+    pub fn is_function_not_found(&self) -> bool {
+        self.code == curl_sys::CURLE_FUNCTION_NOT_FOUND
+    }
+
+    /// Returns whether this error corresponds to CURLE_ABORTED_BY_CALLBACK.
+    pub fn is_aborted_by_callback(&self) -> bool {
+        self.code == curl_sys::CURLE_ABORTED_BY_CALLBACK
+    }
+
+    /// Returns whether this error corresponds to CURLE_BAD_FUNCTION_ARGUMENT.
+    pub fn is_bad_function_argument(&self) -> bool {
+        self.code == curl_sys::CURLE_BAD_FUNCTION_ARGUMENT
+    }
+
+    /// Returns whether this error corresponds to CURLE_INTERFACE_FAILED.
+    pub fn is_interface_failed(&self) -> bool {
+        self.code == curl_sys::CURLE_INTERFACE_FAILED
+    }
+
+    /// Returns whether this error corresponds to CURLE_TOO_MANY_REDIRECTS.
+    pub fn is_too_many_redirects(&self) -> bool {
+        self.code == curl_sys::CURLE_TOO_MANY_REDIRECTS
+    }
+
+    /// Returns whether this error corresponds to CURLE_UNKNOWN_OPTION.
+    pub fn is_unknown_option(&self) -> bool {
+        self.code == curl_sys::CURLE_UNKNOWN_OPTION
+    }
+
+    /// Returns whether this error corresponds to CURLE_PEER_FAILED_VERIFICATION.
+    pub fn is_peer_failed_verification(&self) -> bool {
+        self.code == curl_sys::CURLE_PEER_FAILED_VERIFICATION
+    }
+
+    /// Returns whether this error corresponds to CURLE_GOT_NOTHING.
+    pub fn is_got_nothing(&self) -> bool {
+        self.code == curl_sys::CURLE_GOT_NOTHING
+    }
+
+    /// Returns whether this error corresponds to CURLE_SSL_ENGINE_NOTFOUND.
+    pub fn is_ssl_engine_notfound(&self) -> bool {
+        self.code == curl_sys::CURLE_SSL_ENGINE_NOTFOUND
+    }
+
+    /// Returns whether this error corresponds to CURLE_SSL_ENGINE_SETFAILED.
+    pub fn is_ssl_engine_setfailed(&self) -> bool {
+        self.code == curl_sys::CURLE_SSL_ENGINE_SETFAILED
+    }
+
+    /// Returns whether this error corresponds to CURLE_SEND_ERROR.
+    pub fn is_send_error(&self) -> bool {
+        self.code == curl_sys::CURLE_SEND_ERROR
+    }
+
+    /// Returns whether this error corresponds to CURLE_RECV_ERROR.
+    pub fn is_recv_error(&self) -> bool {
+        self.code == curl_sys::CURLE_RECV_ERROR
+    }
+
+    /// Returns whether this error corresponds to CURLE_SSL_CERTPROBLEM.
+    pub fn is_ssl_certproblem(&self) -> bool {
+        self.code == curl_sys::CURLE_SSL_CERTPROBLEM
+    }
+
+    /// Returns whether this error corresponds to CURLE_SSL_CIPHER.
+    pub fn is_ssl_cipher(&self) -> bool {
+        self.code == curl_sys::CURLE_SSL_CIPHER
+    }
+
+    /// Returns whether this error corresponds to CURLE_SSL_CACERT.
+    pub fn is_ssl_cacert(&self) -> bool {
+        self.code == curl_sys::CURLE_SSL_CACERT
+    }
+
+    /// Returns whether this error corresponds to CURLE_BAD_CONTENT_ENCODING.
+    pub fn is_bad_content_encoding(&self) -> bool {
+        self.code == curl_sys::CURLE_BAD_CONTENT_ENCODING
+    }
+
+    /// Returns whether this error corresponds to CURLE_FILESIZE_EXCEEDED.
+    pub fn is_filesize_exceeded(&self) -> bool {
+        self.code == curl_sys::CURLE_FILESIZE_EXCEEDED
+    }
+
+    /// Returns whether this error corresponds to CURLE_USE_SSL_FAILED.
+    pub fn is_use_ssl_failed(&self) -> bool {
+        self.code == curl_sys::CURLE_USE_SSL_FAILED
+    }
+
+    /// Returns whether this error corresponds to CURLE_SEND_FAIL_REWIND.
+    pub fn is_send_fail_rewind(&self) -> bool {
+        self.code == curl_sys::CURLE_SEND_FAIL_REWIND
+    }
+
+    /// Returns whether this error corresponds to CURLE_SSL_ENGINE_INITFAILED.
+    pub fn is_ssl_engine_initfailed(&self) -> bool {
+        self.code == curl_sys::CURLE_SSL_ENGINE_INITFAILED
+    }
+
+    /// Returns whether this error corresponds to CURLE_LOGIN_DENIED.
+    pub fn is_login_denied(&self) -> bool {
+        self.code == curl_sys::CURLE_LOGIN_DENIED
+    }
+
+    /// Returns whether this error corresponds to CURLE_CONV_FAILED.
+    pub fn is_conv_failed(&self) -> bool {
+        self.code == curl_sys::CURLE_CONV_FAILED
+    }
+
+    /// Returns whether this error corresponds to CURLE_CONV_REQD.
+    pub fn is_conv_required(&self) -> bool {
+        self.code == curl_sys::CURLE_CONV_REQD
+    }
+
+    /// Returns whether this error corresponds to CURLE_SSL_CACERT_BADFILE.
+    pub fn is_ssl_cacert_badfile(&self) -> bool {
+        self.code == curl_sys::CURLE_SSL_CACERT_BADFILE
+    }
+
+    /// Returns whether this error corresponds to CURLE_SSL_CRL_BADFILE.
+    pub fn is_ssl_crl_badfile(&self) -> bool {
+        self.code == curl_sys::CURLE_SSL_CRL_BADFILE
+    }
+
+    /// Returns whether this error corresponds to CURLE_SSL_SHUTDOWN_FAILED.
+    pub fn is_ssl_shutdown_failed(&self) -> bool {
+        self.code == curl_sys::CURLE_SSL_SHUTDOWN_FAILED
+    }
+
+    /// Returns whether this error corresponds to CURLE_AGAIN.
+    pub fn is_again(&self) -> bool {
+        self.code == curl_sys::CURLE_AGAIN
+    }
+
+    /// Returns whether this error corresponds to CURLE_SSL_ISSUER_ERROR.
+    pub fn is_ssl_issuer_error(&self) -> bool {
+        self.code == curl_sys::CURLE_SSL_ISSUER_ERROR
+    }
+
+    /// Returns whether this error corresponds to CURLE_CHUNK_FAILED.
+    pub fn is_chunk_failed(&self) -> bool {
+        self.code == curl_sys::CURLE_CHUNK_FAILED
+    }
+
+    /// Returns whether this error corresponds to CURLE_HTTP2.
+    pub fn is_http2_error(&self) -> bool {
+        self.code == curl_sys::CURLE_HTTP2
+    }
+
+    /// Returns whether this error corresponds to CURLE_HTTP2_STREAM.
+    pub fn is_http2_stream_error(&self) -> bool {
+        self.code == curl_sys::CURLE_HTTP2_STREAM
+    }
+
+    // /// Returns whether this error corresponds to CURLE_NO_CONNECTION_AVAILABLE.
+    // pub fn is_no_connection_available(&self) -> bool {
+    //     self.code == curl_sys::CURLE_NO_CONNECTION_AVAILABLE
+    // }
+
+    /// Returns the value of the underlying error corresponding to libcurl.
+    pub fn code(&self) -> curl_sys::CURLcode {
+        self.code
+    }
+
+    /// Returns the general description of this error code, using curl's
+    /// builtin `strerror`-like functionality.
+    pub fn description(&self) -> &str {
+        unsafe {
+            let s = curl_sys::curl_easy_strerror(self.code);
+            assert!(!s.is_null());
+            str::from_utf8(CStr::from_ptr(s).to_bytes()).unwrap()
+        }
+    }
+
+    /// Returns the extra description of this error, if any is available.
+    pub fn extra_description(&self) -> Option<&str> {
+        self.extra.as_deref()
+    }
+}
+
+impl fmt::Display for Error {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let desc = self.description();
+        match self.extra {
+            Some(ref s) => write!(f, "[{}] {} ({})", self.code(), desc, s),
+            None => write!(f, "[{}] {}", self.code(), desc),
+        }
+    }
+}
+
+impl fmt::Debug for Error {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("Error")
+            .field("description", &self.description())
+            .field("code", &self.code)
+            .field("extra", &self.extra)
+            .finish()
+    }
+}
+
+impl error::Error for Error {}
+
+/// An error returned from "share" operations.
+///
+/// This structure wraps a `CURLSHcode`.
+#[derive(Clone, PartialEq)]
+pub struct ShareError {
+    code: curl_sys::CURLSHcode,
+}
+
+impl ShareError {
+    /// Creates a new error from the underlying code returned by libcurl.
+    pub fn new(code: curl_sys::CURLSHcode) -> ShareError {
+        ShareError { code }
+    }
+
+    /// Returns whether this error corresponds to CURLSHE_BAD_OPTION.
+    pub fn is_bad_option(&self) -> bool {
+        self.code == curl_sys::CURLSHE_BAD_OPTION
+    }
+
+    /// Returns whether this error corresponds to CURLSHE_IN_USE.
+    pub fn is_in_use(&self) -> bool {
+        self.code == curl_sys::CURLSHE_IN_USE
+    }
+
+    /// Returns whether this error corresponds to CURLSHE_INVALID.
+    pub fn is_invalid(&self) -> bool {
+        self.code == curl_sys::CURLSHE_INVALID
+    }
+
+    /// Returns whether this error corresponds to CURLSHE_NOMEM.
+    pub fn is_nomem(&self) -> bool {
+        self.code == curl_sys::CURLSHE_NOMEM
+    }
+
+    // /// Returns whether this error corresponds to CURLSHE_NOT_BUILT_IN.
+    // pub fn is_not_built_in(&self) -> bool {
+    //     self.code == curl_sys::CURLSHE_NOT_BUILT_IN
+    // }
+
+    /// Returns the value of the underlying error corresponding to libcurl.
+    pub fn code(&self) -> curl_sys::CURLSHcode {
+        self.code
+    }
+
+    /// Returns curl's human-readable version of this error.
+    pub fn description(&self) -> &str {
+        unsafe {
+            let s = curl_sys::curl_share_strerror(self.code);
+            assert!(!s.is_null());
+            str::from_utf8(CStr::from_ptr(s).to_bytes()).unwrap()
+        }
+    }
+}
+
+impl fmt::Display for ShareError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.description().fmt(f)
+    }
+}
+
+impl fmt::Debug for ShareError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(
+            f,
+            "ShareError {{ description: {:?}, code: {} }}",
+            self.description(),
+            self.code
+        )
+    }
+}
+
+impl error::Error for ShareError {}
+
+/// An error from "multi" operations.
+///
+/// THis structure wraps a `CURLMcode`.
+#[derive(Clone, PartialEq)]
+pub struct MultiError {
+    code: curl_sys::CURLMcode,
+}
+
+impl MultiError {
+    /// Creates a new error from the underlying code returned by libcurl.
+    pub fn new(code: curl_sys::CURLMcode) -> MultiError {
+        MultiError { code }
+    }
+
+    /// Returns whether this error corresponds to CURLM_BAD_HANDLE.
+    pub fn is_bad_handle(&self) -> bool {
+        self.code == curl_sys::CURLM_BAD_HANDLE
+    }
+
+    /// Returns whether this error corresponds to CURLM_BAD_EASY_HANDLE.
+    pub fn is_bad_easy_handle(&self) -> bool {
+        self.code == curl_sys::CURLM_BAD_EASY_HANDLE
+    }
+
+    /// Returns whether this error corresponds to CURLM_OUT_OF_MEMORY.
+    pub fn is_out_of_memory(&self) -> bool {
+        self.code == curl_sys::CURLM_OUT_OF_MEMORY
+    }
+
+    /// Returns whether this error corresponds to CURLM_INTERNAL_ERROR.
+    pub fn is_internal_error(&self) -> bool {
+        self.code == curl_sys::CURLM_INTERNAL_ERROR
+    }
+
+    /// Returns whether this error corresponds to CURLM_BAD_SOCKET.
+    pub fn is_bad_socket(&self) -> bool {
+        self.code == curl_sys::CURLM_BAD_SOCKET
+    }
+
+    /// Returns whether this error corresponds to CURLM_UNKNOWN_OPTION.
+    pub fn is_unknown_option(&self) -> bool {
+        self.code == curl_sys::CURLM_UNKNOWN_OPTION
+    }
+
+    /// Returns whether this error corresponds to CURLM_CALL_MULTI_PERFORM.
+    pub fn is_call_perform(&self) -> bool {
+        self.code == curl_sys::CURLM_CALL_MULTI_PERFORM
+    }
+
+    // /// Returns whether this error corresponds to CURLM_ADDED_ALREADY.
+    // pub fn is_added_already(&self) -> bool {
+    //     self.code == curl_sys::CURLM_ADDED_ALREADY
+    // }
+
+    /// Returns the value of the underlying error corresponding to libcurl.
+    pub fn code(&self) -> curl_sys::CURLMcode {
+        self.code
+    }
+
+    /// Returns curl's human-readable description of this error.
+    pub fn description(&self) -> &str {
+        unsafe {
+            let s = curl_sys::curl_multi_strerror(self.code);
+            assert!(!s.is_null());
+            str::from_utf8(CStr::from_ptr(s).to_bytes()).unwrap()
+        }
+    }
+}
+
+impl fmt::Display for MultiError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.description().fmt(f)
+    }
+}
+
+impl fmt::Debug for MultiError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("MultiError")
+            .field("description", &self.description())
+            .field("code", &self.code)
+            .finish()
+    }
+}
+
+impl error::Error for MultiError {}
+
+/// An error from "form add" operations.
+///
+/// THis structure wraps a `CURLFORMcode`.
+#[derive(Clone, PartialEq)]
+pub struct FormError {
+    code: curl_sys::CURLFORMcode,
+}
+
+impl FormError {
+    /// Creates a new error from the underlying code returned by libcurl.
+    pub fn new(code: curl_sys::CURLFORMcode) -> FormError {
+        FormError { code }
+    }
+
+    /// Returns whether this error corresponds to CURL_FORMADD_MEMORY.
+    pub fn is_memory(&self) -> bool {
+        self.code == curl_sys::CURL_FORMADD_MEMORY
+    }
+
+    /// Returns whether this error corresponds to CURL_FORMADD_OPTION_TWICE.
+    pub fn is_option_twice(&self) -> bool {
+        self.code == curl_sys::CURL_FORMADD_OPTION_TWICE
+    }
+
+    /// Returns whether this error corresponds to CURL_FORMADD_NULL.
+    pub fn is_null(&self) -> bool {
+        self.code == curl_sys::CURL_FORMADD_NULL
+    }
+
+    /// Returns whether this error corresponds to CURL_FORMADD_UNKNOWN_OPTION.
+    pub fn is_unknown_option(&self) -> bool {
+        self.code == curl_sys::CURL_FORMADD_UNKNOWN_OPTION
+    }
+
+    /// Returns whether this error corresponds to CURL_FORMADD_INCOMPLETE.
+    pub fn is_incomplete(&self) -> bool {
+        self.code == curl_sys::CURL_FORMADD_INCOMPLETE
+    }
+
+    /// Returns whether this error corresponds to CURL_FORMADD_ILLEGAL_ARRAY.
+    pub fn is_illegal_array(&self) -> bool {
+        self.code == curl_sys::CURL_FORMADD_ILLEGAL_ARRAY
+    }
+
+    /// Returns whether this error corresponds to CURL_FORMADD_DISABLED.
+    pub fn is_disabled(&self) -> bool {
+        self.code == curl_sys::CURL_FORMADD_DISABLED
+    }
+
+    /// Returns the value of the underlying error corresponding to libcurl.
+    pub fn code(&self) -> curl_sys::CURLFORMcode {
+        self.code
+    }
+
+    /// Returns a human-readable description of this error code.
+    pub fn description(&self) -> &str {
+        match self.code {
+            curl_sys::CURL_FORMADD_MEMORY => "allocation failure",
+            curl_sys::CURL_FORMADD_OPTION_TWICE => "one option passed twice",
+            curl_sys::CURL_FORMADD_NULL => "null pointer given for string",
+            curl_sys::CURL_FORMADD_UNKNOWN_OPTION => "unknown option",
+            curl_sys::CURL_FORMADD_INCOMPLETE => "form information not complete",
+            curl_sys::CURL_FORMADD_ILLEGAL_ARRAY => "illegal array in option",
+            curl_sys::CURL_FORMADD_DISABLED => {
+                "libcurl does not have support for this option compiled in"
+            }
+            _ => "unknown form error",
+        }
+    }
+}
+
+impl fmt::Display for FormError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.description().fmt(f)
+    }
+}
+
+impl fmt::Debug for FormError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("FormError")
+            .field("description", &self.description())
+            .field("code", &self.code)
+            .finish()
+    }
+}
+
+impl error::Error for FormError {}
+
+impl From<ffi::NulError> for Error {
+    fn from(_: ffi::NulError) -> Error {
+        Error {
+            code: curl_sys::CURLE_CONV_FAILED,
+            extra: None,
+        }
+    }
+}
+
+impl From<Error> for io::Error {
+    fn from(e: Error) -> io::Error {
+        io::Error::new(io::ErrorKind::Other, e)
+    }
+}
+
+impl From<ShareError> for io::Error {
+    fn from(e: ShareError) -> io::Error {
+        io::Error::new(io::ErrorKind::Other, e)
+    }
+}
+
+impl From<MultiError> for io::Error {
+    fn from(e: MultiError) -> io::Error {
+        io::Error::new(io::ErrorKind::Other, e)
+    }
+}
+
+impl From<FormError> for io::Error {
+    fn from(e: FormError) -> io::Error {
+        io::Error::new(io::ErrorKind::Other, e)
+    }
+}
+
\ No newline at end of file diff --git a/src/curl/lib.rs.html b/src/curl/lib.rs.html new file mode 100644 index 000000000..40c5959db --- /dev/null +++ b/src/curl/lib.rs.html @@ -0,0 +1,370 @@ +lib.rs - source +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+
//! Rust bindings to the libcurl C library
+//!
+//! This crate contains bindings for an HTTP/HTTPS client which is powered by
+//! [libcurl], the same library behind the `curl` command line tool. The API
+//! currently closely matches that of libcurl itself, except that a Rustic layer
+//! of safety is applied on top.
+//!
+//! [libcurl]: https://curl.haxx.se/libcurl/
+//!
+//! # The "Easy" API
+//!
+//! The easiest way to send a request is to use the `Easy` api which corresponds
+//! to `CURL` in libcurl. This handle supports a wide variety of options and can
+//! be used to make a single blocking request in a thread. Callbacks can be
+//! specified to deal with data as it arrives and a handle can be reused to
+//! cache connections and such.
+//!
+//! ```rust,no_run
+//! use std::io::{stdout, Write};
+//!
+//! use curl::easy::Easy;
+//!
+//! // Write the contents of rust-lang.org to stdout
+//! let mut easy = Easy::new();
+//! easy.url("https://www.rust-lang.org/").unwrap();
+//! easy.write_function(|data| {
+//!     stdout().write_all(data).unwrap();
+//!     Ok(data.len())
+//! }).unwrap();
+//! easy.perform().unwrap();
+//! ```
+//!
+//! # What about multiple concurrent HTTP requests?
+//!
+//! One option you have currently is to send multiple requests in multiple
+//! threads, but otherwise libcurl has a "multi" interface for doing this
+//! operation. Initial bindings of this interface can be found in the `multi`
+//! module, but feedback is welcome!
+//!
+//! # Where does libcurl come from?
+//!
+//! This crate links to the `curl-sys` crate which is in turn responsible for
+//! acquiring and linking to the libcurl library. Currently this crate will
+//! build libcurl from source if one is not already detected on the system.
+//!
+//! There is a large number of releases for libcurl, all with different sets of
+//! capabilities. Robust programs may wish to inspect `Version::get()` to test
+//! what features are implemented in the linked build of libcurl at runtime.
+//!
+//! # Initialization
+//!
+//! The underlying libcurl library must be initialized before use and has
+//! certain requirements on how this is done. Check the documentation for
+//! [`init`] for more details.
+
+#![deny(missing_docs, missing_debug_implementations)]
+#![doc(html_root_url = "https://docs.rs/curl/0.4")]
+
+use std::ffi::CStr;
+use std::str;
+use std::sync::Once;
+
+pub use crate::error::{Error, FormError, MultiError, ShareError};
+mod error;
+
+pub use crate::version::{Protocols, Version};
+mod version;
+
+pub mod easy;
+pub mod multi;
+mod panic;
+
+#[cfg(test)]
+static INITIALIZED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
+
+/// Initializes the underlying libcurl library.
+///
+/// The underlying libcurl library must be initialized before use, and must be
+/// done so on the main thread before any other threads are created by the
+/// program. This crate will do this for you automatically in the following
+/// scenarios:
+///
+/// - Creating a new [`Easy`][easy::Easy] or [`Multi`][multi::Multi] handle
+/// - At program startup on Windows, macOS, Linux, Android, or FreeBSD systems
+///
+/// This should be sufficient for most applications and scenarios, but in any
+/// other case, it is strongly recommended that you call this function manually
+/// as soon as your program starts.
+///
+/// Calling this function more than once is harmless and has no effect.
+#[inline]
+pub fn init() {
+    /// Used to prevent concurrent or duplicate initialization.
+    static INIT: Once = Once::new();
+
+    INIT.call_once(|| {
+        #[cfg(need_openssl_init)]
+        openssl_probe::init_ssl_cert_env_vars();
+        #[cfg(need_openssl_init)]
+        openssl_sys::init();
+
+        unsafe {
+            assert_eq!(curl_sys::curl_global_init(curl_sys::CURL_GLOBAL_ALL), 0);
+        }
+
+        #[cfg(test)]
+        {
+            INITIALIZED.store(true, std::sync::atomic::Ordering::SeqCst);
+        }
+
+        // Note that we explicitly don't schedule a call to
+        // `curl_global_cleanup`. The documentation for that function says
+        //
+        // > You must not call it when any other thread in the program (i.e. a
+        // > thread sharing the same memory) is running. This doesn't just mean
+        // > no other thread that is using libcurl.
+        //
+        // We can't ever be sure of that, so unfortunately we can't call the
+        // function.
+    });
+}
+
+/// An exported constructor function. On supported platforms, this will be
+/// invoked automatically before the program's `main` is called. This is done
+/// for the convenience of library users since otherwise the thread-safety rules
+/// around initialization can be difficult to fulfill.
+///
+/// This is a hidden public item to ensure the symbol isn't optimized away by a
+/// rustc/LLVM bug: https://github.com/rust-lang/rust/issues/47384. As long as
+/// any item in this module is used by the final binary (which `init` will be)
+/// then this symbol should be preserved.
+#[used]
+#[doc(hidden)]
+#[cfg_attr(
+    any(target_os = "linux", target_os = "freebsd", target_os = "android"),
+    link_section = ".init_array"
+)]
+#[cfg_attr(target_os = "macos", link_section = "__DATA,__mod_init_func")]
+#[cfg_attr(target_os = "windows", link_section = ".CRT$XCU")]
+pub static INIT_CTOR: extern "C" fn() = {
+    /// This is the body of our constructor function.
+    #[cfg_attr(
+        any(target_os = "linux", target_os = "android"),
+        link_section = ".text.startup"
+    )]
+    extern "C" fn init_ctor() {
+        init();
+    }
+
+    init_ctor
+};
+
+unsafe fn opt_str<'a>(ptr: *const libc::c_char) -> Option<&'a str> {
+    if ptr.is_null() {
+        None
+    } else {
+        Some(str::from_utf8(CStr::from_ptr(ptr).to_bytes()).unwrap())
+    }
+}
+
+fn cvt(r: curl_sys::CURLcode) -> Result<(), Error> {
+    if r == curl_sys::CURLE_OK {
+        Ok(())
+    } else {
+        Err(Error::new(r))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    #[cfg(any(
+        target_os = "linux",
+        target_os = "macos",
+        target_os = "windows",
+        target_os = "freebsd",
+        target_os = "android"
+    ))]
+    fn is_initialized_before_main() {
+        assert!(INITIALIZED.load(std::sync::atomic::Ordering::SeqCst));
+    }
+}
+
\ No newline at end of file diff --git a/src/curl/multi.rs.html b/src/curl/multi.rs.html new file mode 100644 index 000000000..7ae39cce4 --- /dev/null +++ b/src/curl/multi.rs.html @@ -0,0 +1,2666 @@ +multi.rs - source +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+
//! Multi - initiating multiple requests simultaneously
+
+use std::fmt;
+use std::marker;
+use std::ptr;
+use std::sync::Arc;
+use std::time::Duration;
+
+use curl_sys;
+use libc::{c_char, c_int, c_long, c_short, c_void};
+
+#[cfg(unix)]
+use libc::{pollfd, POLLIN, POLLOUT, POLLPRI};
+
+use crate::easy::{Easy, Easy2, List};
+use crate::panic;
+use crate::{Error, MultiError};
+
+/// A multi handle for initiating multiple connections simultaneously.
+///
+/// This structure corresponds to `CURLM` in libcurl and provides the ability to
+/// have multiple transfers in flight simultaneously. This handle is then used
+/// to manage each transfer. The main purpose of a `CURLM` is for the
+/// *application* to drive the I/O rather than libcurl itself doing all the
+/// blocking. Methods like `action` allow the application to inform libcurl of
+/// when events have happened.
+///
+/// Lots more documentation can be found on the libcurl [multi tutorial] where
+/// the APIs correspond pretty closely with this crate.
+///
+/// [multi tutorial]: https://curl.haxx.se/libcurl/c/libcurl-multi.html
+pub struct Multi {
+    raw: Arc<RawMulti>,
+    data: Box<MultiData>,
+}
+
+#[derive(Debug)]
+struct RawMulti {
+    handle: *mut curl_sys::CURLM,
+}
+
+struct MultiData {
+    socket: Box<dyn FnMut(Socket, SocketEvents, usize) + Send>,
+    timer: Box<dyn FnMut(Option<Duration>) -> bool + Send>,
+}
+
+/// Message from the `messages` function of a multi handle.
+///
+/// Currently only indicates whether a transfer is done.
+pub struct Message<'multi> {
+    ptr: *mut curl_sys::CURLMsg,
+    _multi: &'multi Multi,
+}
+
+/// Wrapper around an easy handle while it's owned by a multi handle.
+///
+/// Once an easy handle has been added to a multi handle then it can no longer
+/// be used via `perform`. This handle is also used to remove the easy handle
+/// from the multi handle when desired.
+pub struct EasyHandle {
+    // Safety: This *must* be before `easy` as it must be dropped first.
+    guard: DetachGuard,
+    easy: Easy,
+    // This is now effectively bound to a `Multi`, so it is no longer sendable.
+    _marker: marker::PhantomData<&'static Multi>,
+}
+
+/// Wrapper around an easy handle while it's owned by a multi handle.
+///
+/// Once an easy handle has been added to a multi handle then it can no longer
+/// be used via `perform`. This handle is also used to remove the easy handle
+/// from the multi handle when desired.
+pub struct Easy2Handle<H> {
+    // Safety: This *must* be before `easy` as it must be dropped first.
+    guard: DetachGuard,
+    easy: Easy2<H>,
+    // This is now effectively bound to a `Multi`, so it is no longer sendable.
+    _marker: marker::PhantomData<&'static Multi>,
+}
+
+/// A guard struct which guarantees that `curl_multi_remove_handle` will be
+/// called on an easy handle, either manually or on drop.
+struct DetachGuard {
+    multi: Arc<RawMulti>,
+    easy: *mut curl_sys::CURL,
+}
+
+/// Notification of the events that have happened on a socket.
+///
+/// This type is passed as an argument to the `action` method on a multi handle
+/// to indicate what events have occurred on a socket.
+pub struct Events {
+    bits: c_int,
+}
+
+/// Notification of events that are requested on a socket.
+///
+/// This type is yielded to the `socket_function` callback to indicate what
+/// events are requested on a socket.
+pub struct SocketEvents {
+    bits: c_int,
+}
+
+/// Raw underlying socket type that the multi handles use
+pub type Socket = curl_sys::curl_socket_t;
+
+/// File descriptor to wait on for use with the `wait` method on a multi handle.
+pub struct WaitFd {
+    inner: curl_sys::curl_waitfd,
+}
+
+/// A handle that can be used to wake up a thread that's blocked in [Multi::poll].
+/// The handle can be passed to and used from any thread.
+#[cfg(feature = "poll_7_68_0")]
+#[derive(Debug, Clone)]
+pub struct MultiWaker {
+    raw: std::sync::Weak<RawMulti>,
+}
+
+#[cfg(feature = "poll_7_68_0")]
+unsafe impl Send for MultiWaker {}
+
+#[cfg(feature = "poll_7_68_0")]
+unsafe impl Sync for MultiWaker {}
+
+impl Multi {
+    /// Creates a new multi session through which multiple HTTP transfers can be
+    /// initiated.
+    pub fn new() -> Multi {
+        unsafe {
+            crate::init();
+            let ptr = curl_sys::curl_multi_init();
+            assert!(!ptr.is_null());
+            Multi {
+                raw: Arc::new(RawMulti { handle: ptr }),
+                data: Box::new(MultiData {
+                    socket: Box::new(|_, _, _| ()),
+                    timer: Box::new(|_| true),
+                }),
+            }
+        }
+    }
+
+    /// Set the callback informed about what to wait for
+    ///
+    /// When the `action` function runs, it informs the application about
+    /// updates in the socket (file descriptor) status by doing none, one, or
+    /// multiple calls to the socket callback. The callback gets status updates
+    /// with changes since the previous time the callback was called. See
+    /// `action` for more details on how the callback is used and should work.
+    ///
+    /// The `SocketEvents` parameter informs the callback on the status of the
+    /// given socket, and the methods on that type can be used to learn about
+    /// what's going on with the socket.
+    ///
+    /// The third `usize` parameter is a custom value set by the `assign` method
+    /// below.
+    pub fn socket_function<F>(&mut self, f: F) -> Result<(), MultiError>
+    where
+        F: FnMut(Socket, SocketEvents, usize) + Send + 'static,
+    {
+        self._socket_function(Box::new(f))
+    }
+
+    fn _socket_function(
+        &mut self,
+        f: Box<dyn FnMut(Socket, SocketEvents, usize) + Send>,
+    ) -> Result<(), MultiError> {
+        self.data.socket = f;
+        let cb: curl_sys::curl_socket_callback = cb;
+        self.setopt_ptr(
+            curl_sys::CURLMOPT_SOCKETFUNCTION,
+            cb as usize as *const c_char,
+        )?;
+        let ptr = &*self.data as *const _;
+        self.setopt_ptr(curl_sys::CURLMOPT_SOCKETDATA, ptr as *const c_char)?;
+        return Ok(());
+
+        // TODO: figure out how to expose `_easy`
+        extern "C" fn cb(
+            _easy: *mut curl_sys::CURL,
+            socket: curl_sys::curl_socket_t,
+            what: c_int,
+            userptr: *mut c_void,
+            socketp: *mut c_void,
+        ) -> c_int {
+            panic::catch(|| unsafe {
+                let f = &mut (*(userptr as *mut MultiData)).socket;
+                f(socket, SocketEvents { bits: what }, socketp as usize)
+            });
+            0
+        }
+    }
+
+    /// Set data to associate with an internal socket
+    ///
+    /// This function creates an association in the multi handle between the
+    /// given socket and a private token of the application. This is designed
+    /// for `action` uses.
+    ///
+    /// When set, the token will be passed to all future socket callbacks for
+    /// the specified socket.
+    ///
+    /// If the given socket isn't already in use by libcurl, this function will
+    /// return an error.
+    ///
+    /// libcurl only keeps one single token associated with a socket, so
+    /// calling this function several times for the same socket will make the
+    /// last set token get used.
+    ///
+    /// The idea here being that this association (socket to token) is something
+    /// that just about every application that uses this API will need and then
+    /// libcurl can just as well do it since it already has an internal hash
+    /// table lookup for this.
+    ///
+    /// # Typical Usage
+    ///
+    /// In a typical application you allocate a struct or at least use some kind
+    /// of semi-dynamic data for each socket that we must wait for action on
+    /// when using the `action` approach.
+    ///
+    /// When our socket-callback gets called by libcurl and we get to know about
+    /// yet another socket to wait for, we can use `assign` to point out the
+    /// particular data so that when we get updates about this same socket
+    /// again, we don't have to find the struct associated with this socket by
+    /// ourselves.
+    pub fn assign(&self, socket: Socket, token: usize) -> Result<(), MultiError> {
+        unsafe {
+            cvt(curl_sys::curl_multi_assign(
+                self.raw.handle,
+                socket,
+                token as *mut _,
+            ))?;
+            Ok(())
+        }
+    }
+
+    /// Set callback to receive timeout values
+    ///
+    /// Certain features, such as timeouts and retries, require you to call
+    /// libcurl even when there is no activity on the file descriptors.
+    ///
+    /// Your callback function should install a non-repeating timer with the
+    /// interval specified. Each time that timer fires, call either `action` or
+    /// `perform`, depending on which interface you use.
+    ///
+    /// A timeout value of `None` means you should delete your timer.
+    ///
+    /// A timeout value of 0 means you should call `action` or `perform` (once)
+    /// as soon as possible.
+    ///
+    /// This callback will only be called when the timeout changes.
+    ///
+    /// The timer callback should return `true` on success, and `false` on
+    /// error. This callback can be used instead of, or in addition to,
+    /// `get_timeout`.
+    pub fn timer_function<F>(&mut self, f: F) -> Result<(), MultiError>
+    where
+        F: FnMut(Option<Duration>) -> bool + Send + 'static,
+    {
+        self._timer_function(Box::new(f))
+    }
+
+    fn _timer_function(
+        &mut self,
+        f: Box<dyn FnMut(Option<Duration>) -> bool + Send>,
+    ) -> Result<(), MultiError> {
+        self.data.timer = f;
+        let cb: curl_sys::curl_multi_timer_callback = cb;
+        self.setopt_ptr(
+            curl_sys::CURLMOPT_TIMERFUNCTION,
+            cb as usize as *const c_char,
+        )?;
+        let ptr = &*self.data as *const _;
+        self.setopt_ptr(curl_sys::CURLMOPT_TIMERDATA, ptr as *const c_char)?;
+        return Ok(());
+
+        // TODO: figure out how to expose `_multi`
+        extern "C" fn cb(
+            _multi: *mut curl_sys::CURLM,
+            timeout_ms: c_long,
+            user: *mut c_void,
+        ) -> c_int {
+            let keep_going = panic::catch(|| unsafe {
+                let f = &mut (*(user as *mut MultiData)).timer;
+                if timeout_ms == -1 {
+                    f(None)
+                } else {
+                    f(Some(Duration::from_millis(timeout_ms as u64)))
+                }
+            })
+            .unwrap_or(false);
+            if keep_going {
+                0
+            } else {
+                -1
+            }
+        }
+    }
+
+    /// Enable or disable HTTP pipelining and multiplexing.
+    ///
+    /// When http_1 is true, enable HTTP/1.1 pipelining, which means that if
+    /// you add a second request that can use an already existing connection,
+    /// the second request will be "piped" on the same connection rather than
+    /// being executed in parallel.
+    ///
+    /// When multiplex is true, enable HTTP/2 multiplexing, which means that
+    /// follow-up requests can re-use an existing connection and send the new
+    /// request multiplexed over that at the same time as other transfers are
+    /// already using that single connection.
+    pub fn pipelining(&mut self, http_1: bool, multiplex: bool) -> Result<(), MultiError> {
+        let bitmask = if http_1 { curl_sys::CURLPIPE_HTTP1 } else { 0 }
+            | if multiplex {
+                curl_sys::CURLPIPE_MULTIPLEX
+            } else {
+                0
+            };
+        self.setopt_long(curl_sys::CURLMOPT_PIPELINING, bitmask)
+    }
+
+    /// Sets the max number of connections to a single host.
+    ///
+    /// Pass a long to indicate the max number of simultaneously open connections
+    /// to a single host (a host being the same as a host name + port number pair).
+    /// For each new session to a host, libcurl will open up a new connection up to the
+    /// limit set by the provided value. When the limit is reached, the sessions will
+    /// be pending until a connection becomes available. If pipelining is enabled,
+    /// libcurl will try to pipeline if the host is capable of it.
+    pub fn set_max_host_connections(&mut self, val: usize) -> Result<(), MultiError> {
+        self.setopt_long(curl_sys::CURLMOPT_MAX_HOST_CONNECTIONS, val as c_long)
+    }
+
+    /// Sets the max simultaneously open connections.
+    ///
+    /// The set number will be used as the maximum number of simultaneously open
+    /// connections in total using this multi handle. For each new session,
+    /// libcurl will open a new connection up to the limit set by the provided
+    /// value. When the limit is reached, the sessions will be pending until
+    /// there are available connections. If pipelining is enabled, libcurl will
+    /// try to pipeline or use multiplexing if the host is capable of it.
+    pub fn set_max_total_connections(&mut self, val: usize) -> Result<(), MultiError> {
+        self.setopt_long(curl_sys::CURLMOPT_MAX_TOTAL_CONNECTIONS, val as c_long)
+    }
+
+    /// Set size of connection cache.
+    ///
+    /// The set number will be used as the maximum amount of simultaneously open
+    /// connections that libcurl may keep in its connection cache after
+    /// completed use. By default libcurl will enlarge the size for each added
+    /// easy handle to make it fit 4 times the number of added easy handles.
+    ///
+    /// By setting this option, you can prevent the cache size from growing
+    /// beyond the limit set by you.
+    ///
+    /// When the cache is full, curl closes the oldest one in the cache to
+    /// prevent the number of open connections from increasing.
+    ///
+    /// See [`set_max_total_connections`](#method.set_max_total_connections) for
+    /// limiting the number of active connections.
+    pub fn set_max_connects(&mut self, val: usize) -> Result<(), MultiError> {
+        self.setopt_long(curl_sys::CURLMOPT_MAXCONNECTS, val as c_long)
+    }
+
+    /// Sets the pipeline length.
+    ///
+    /// This sets the max number that will be used as the maximum amount of
+    /// outstanding requests in an HTTP/1.1 pipelined connection. This option
+    /// is only used for HTTP/1.1 pipelining, and not HTTP/2 multiplexing.
+    pub fn set_pipeline_length(&mut self, val: usize) -> Result<(), MultiError> {
+        self.setopt_long(curl_sys::CURLMOPT_MAX_PIPELINE_LENGTH, val as c_long)
+    }
+
+    /// Sets the number of max concurrent streams for http2.
+    ///
+    /// This sets the max number will be used as the maximum number of
+    /// concurrent streams for a connections that libcurl should support on
+    /// connections done using HTTP/2. Defaults to 100.
+    pub fn set_max_concurrent_streams(&mut self, val: usize) -> Result<(), MultiError> {
+        self.setopt_long(curl_sys::CURLMOPT_MAX_CONCURRENT_STREAMS, val as c_long)
+    }
+
+    fn setopt_long(&mut self, opt: curl_sys::CURLMoption, val: c_long) -> Result<(), MultiError> {
+        unsafe { cvt(curl_sys::curl_multi_setopt(self.raw.handle, opt, val)) }
+    }
+
+    fn setopt_ptr(
+        &mut self,
+        opt: curl_sys::CURLMoption,
+        val: *const c_char,
+    ) -> Result<(), MultiError> {
+        unsafe { cvt(curl_sys::curl_multi_setopt(self.raw.handle, opt, val)) }
+    }
+
+    /// Add an easy handle to a multi session
+    ///
+    /// Adds a standard easy handle to the multi stack. This function call will
+    /// make this multi handle control the specified easy handle.
+    ///
+    /// When an easy interface is added to a multi handle, it will use a shared
+    /// connection cache owned by the multi handle. Removing and adding new easy
+    /// handles will not affect the pool of connections or the ability to do
+    /// connection re-use.
+    ///
+    /// If you have `timer_function` set in the multi handle (and you really
+    /// should if you're working event-based with `action` and friends), that
+    /// callback will be called from within this function to ask for an updated
+    /// timer so that your main event loop will get the activity on this handle
+    /// to get started.
+    ///
+    /// The easy handle will remain added to the multi handle until you remove
+    /// it again with `remove` on the returned handle - even when a transfer
+    /// with that specific easy handle is completed.
+    pub fn add(&self, mut easy: Easy) -> Result<EasyHandle, MultiError> {
+        // Clear any configuration set by previous transfers because we're
+        // moving this into a `Send+'static` situation now basically.
+        easy.transfer();
+
+        unsafe {
+            cvt(curl_sys::curl_multi_add_handle(self.raw.handle, easy.raw()))?;
+        }
+        Ok(EasyHandle {
+            guard: DetachGuard {
+                multi: self.raw.clone(),
+                easy: easy.raw(),
+            },
+            easy,
+            _marker: marker::PhantomData,
+        })
+    }
+
+    /// Same as `add`, but works with the `Easy2` type.
+    pub fn add2<H>(&self, easy: Easy2<H>) -> Result<Easy2Handle<H>, MultiError> {
+        unsafe {
+            cvt(curl_sys::curl_multi_add_handle(self.raw.handle, easy.raw()))?;
+        }
+        Ok(Easy2Handle {
+            guard: DetachGuard {
+                multi: self.raw.clone(),
+                easy: easy.raw(),
+            },
+            easy,
+            _marker: marker::PhantomData,
+        })
+    }
+
+    /// Remove an easy handle from this multi session
+    ///
+    /// Removes the easy handle from this multi handle. This will make the
+    /// returned easy handle be removed from this multi handle's control.
+    ///
+    /// When the easy handle has been removed from a multi stack, it is again
+    /// perfectly legal to invoke `perform` on it.
+    ///
+    /// Removing an easy handle while being used is perfectly legal and will
+    /// effectively halt the transfer in progress involving that easy handle.
+    /// All other easy handles and transfers will remain unaffected.
+    pub fn remove(&self, mut easy: EasyHandle) -> Result<Easy, MultiError> {
+        easy.guard.detach()?;
+        Ok(easy.easy)
+    }
+
+    /// Same as `remove`, but for `Easy2Handle`.
+    pub fn remove2<H>(&self, mut easy: Easy2Handle<H>) -> Result<Easy2<H>, MultiError> {
+        easy.guard.detach()?;
+        Ok(easy.easy)
+    }
+
+    /// Read multi stack informationals
+    ///
+    /// Ask the multi handle if there are any messages/informationals from the
+    /// individual transfers. Messages may include informationals such as an
+    /// error code from the transfer or just the fact that a transfer is
+    /// completed. More details on these should be written down as well.
+    pub fn messages<F>(&self, mut f: F)
+    where
+        F: FnMut(Message),
+    {
+        self._messages(&mut f)
+    }
+
+    fn _messages(&self, f: &mut dyn FnMut(Message)) {
+        let mut queue = 0;
+        unsafe {
+            loop {
+                let ptr = curl_sys::curl_multi_info_read(self.raw.handle, &mut queue);
+                if ptr.is_null() {
+                    break;
+                }
+                f(Message { ptr, _multi: self })
+            }
+        }
+    }
+
+    /// Inform of reads/writes available data given an action
+    ///
+    /// When the application has detected action on a socket handled by libcurl,
+    /// it should call this function with the sockfd argument set to
+    /// the socket with the action. When the events on a socket are known, they
+    /// can be passed `events`. When the events on a socket are unknown, pass
+    /// `Events::new()` instead, and libcurl will test the descriptor
+    /// internally.
+    ///
+    /// The returned integer will contain the number of running easy handles
+    /// within the multi handle. When this number reaches zero, all transfers
+    /// are complete/done. When you call `action` on a specific socket and the
+    /// counter decreases by one, it DOES NOT necessarily mean that this exact
+    /// socket/transfer is the one that completed. Use `messages` to figure out
+    /// which easy handle that completed.
+    ///
+    /// The `action` function informs the application about updates in the
+    /// socket (file descriptor) status by doing none, one, or multiple calls to
+    /// the socket callback function set with the `socket_function` method. They
+    /// update the status with changes since the previous time the callback was
+    /// called.
+    pub fn action(&self, socket: Socket, events: &Events) -> Result<u32, MultiError> {
+        let mut remaining = 0;
+        unsafe {
+            cvt(curl_sys::curl_multi_socket_action(
+                self.raw.handle,
+                socket,
+                events.bits,
+                &mut remaining,
+            ))?;
+            Ok(remaining as u32)
+        }
+    }
+
+    /// Inform libcurl that a timeout has expired and sockets should be tested.
+    ///
+    /// The returned integer will contain the number of running easy handles
+    /// within the multi handle. When this number reaches zero, all transfers
+    /// are complete/done. When you call `action` on a specific socket and the
+    /// counter decreases by one, it DOES NOT necessarily mean that this exact
+    /// socket/transfer is the one that completed. Use `messages` to figure out
+    /// which easy handle that completed.
+    ///
+    /// Get the timeout time by calling the `timer_function` method. Your
+    /// application will then get called with information on how long to wait
+    /// for socket actions at most before doing the timeout action: call the
+    /// `timeout` method. You can also use the `get_timeout` function to
+    /// poll the value at any given time, but for an event-based system using
+    /// the callback is far better than relying on polling the timeout value.
+    pub fn timeout(&self) -> Result<u32, MultiError> {
+        let mut remaining = 0;
+        unsafe {
+            cvt(curl_sys::curl_multi_socket_action(
+                self.raw.handle,
+                curl_sys::CURL_SOCKET_BAD,
+                0,
+                &mut remaining,
+            ))?;
+            Ok(remaining as u32)
+        }
+    }
+
+    /// Get how long to wait for action before proceeding
+    ///
+    /// An application using the libcurl multi interface should call
+    /// `get_timeout` to figure out how long it should wait for socket actions -
+    /// at most - before proceeding.
+    ///
+    /// Proceeding means either doing the socket-style timeout action: call the
+    /// `timeout` function, or call `perform` if you're using the simpler and
+    /// older multi interface approach.
+    ///
+    /// The timeout value returned is the duration at this very moment. If 0, it
+    /// means you should proceed immediately without waiting for anything. If it
+    /// returns `None`, there's no timeout at all set.
+    ///
+    /// Note: if libcurl returns a `None` timeout here, it just means that
+    /// libcurl currently has no stored timeout value. You must not wait too
+    /// long (more than a few seconds perhaps) before you call `perform` again.
+    pub fn get_timeout(&self) -> Result<Option<Duration>, MultiError> {
+        let mut ms = 0;
+        unsafe {
+            cvt(curl_sys::curl_multi_timeout(self.raw.handle, &mut ms))?;
+            if ms == -1 {
+                Ok(None)
+            } else {
+                Ok(Some(Duration::from_millis(ms as u64)))
+            }
+        }
+    }
+
+    /// Block until activity is detected or a timeout passes.
+    ///
+    /// The timeout is used in millisecond-precision. Large durations are
+    /// clamped at the maximum value curl accepts.
+    ///
+    /// The returned integer will contain the number of internal file
+    /// descriptors on which interesting events occured.
+    ///
+    /// This function is a simpler alternative to using `fdset()` and `select()`
+    /// and does not suffer from file descriptor limits.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use curl::multi::Multi;
+    /// use std::time::Duration;
+    ///
+    /// let m = Multi::new();
+    ///
+    /// // Add some Easy handles...
+    ///
+    /// while m.perform().unwrap() > 0 {
+    ///     m.wait(&mut [], Duration::from_secs(1)).unwrap();
+    /// }
+    /// ```
+    pub fn wait(&self, waitfds: &mut [WaitFd], timeout: Duration) -> Result<u32, MultiError> {
+        let timeout_ms = Multi::timeout_i32(timeout);
+        unsafe {
+            let mut ret = 0;
+            cvt(curl_sys::curl_multi_wait(
+                self.raw.handle,
+                waitfds.as_mut_ptr() as *mut _,
+                waitfds.len() as u32,
+                timeout_ms,
+                &mut ret,
+            ))?;
+            Ok(ret as u32)
+        }
+    }
+
+    fn timeout_i32(timeout: Duration) -> i32 {
+        let secs = timeout.as_secs();
+        if secs > (i32::MAX / 1000) as u64 {
+            // Duration too large, clamp at maximum value.
+            i32::MAX
+        } else {
+            secs as i32 * 1000 + timeout.subsec_nanos() as i32 / 1_000_000
+        }
+    }
+
+    /// Block until activity is detected or a timeout passes.
+    ///
+    /// The timeout is used in millisecond-precision. Large durations are
+    /// clamped at the maximum value curl accepts.
+    ///
+    /// The returned integer will contain the number of internal file
+    /// descriptors on which interesting events occurred.
+    ///
+    /// This function is a simpler alternative to using `fdset()` and `select()`
+    /// and does not suffer from file descriptor limits.
+    ///
+    /// While this method is similar to [Multi::wait], with the following
+    /// distinctions:
+    /// * If there are no handles added to the multi, poll will honor the
+    /// provided timeout, while [Multi::wait] returns immediately.
+    /// * If poll has blocked due to there being no activity on the handles in
+    /// the Multi, it can be woken up from any thread and at any time before
+    /// the timeout expires.
+    ///
+    /// Requires libcurl 7.66.0 or later.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use curl::multi::Multi;
+    /// use std::time::Duration;
+    ///
+    /// let m = Multi::new();
+    ///
+    /// // Add some Easy handles...
+    ///
+    /// while m.perform().unwrap() > 0 {
+    ///     m.poll(&mut [], Duration::from_secs(1)).unwrap();
+    /// }
+    /// ```
+    #[cfg(feature = "poll_7_68_0")]
+    pub fn poll(&self, waitfds: &mut [WaitFd], timeout: Duration) -> Result<u32, MultiError> {
+        let timeout_ms = Multi::timeout_i32(timeout);
+        unsafe {
+            let mut ret = 0;
+            cvt(curl_sys::curl_multi_poll(
+                self.raw.handle,
+                waitfds.as_mut_ptr() as *mut _,
+                waitfds.len() as u32,
+                timeout_ms,
+                &mut ret,
+            ))?;
+            Ok(ret as u32)
+        }
+    }
+
+    /// Returns a new [MultiWaker] that can be used to wake up a thread that's
+    /// currently blocked in [Multi::poll].
+    #[cfg(feature = "poll_7_68_0")]
+    pub fn waker(&self) -> MultiWaker {
+        MultiWaker::new(Arc::downgrade(&self.raw))
+    }
+
+    /// Reads/writes available data from each easy handle.
+    ///
+    /// This function handles transfers on all the added handles that need
+    /// attention in an non-blocking fashion.
+    ///
+    /// When an application has found out there's data available for this handle
+    /// or a timeout has elapsed, the application should call this function to
+    /// read/write whatever there is to read or write right now etc.  This
+    /// method returns as soon as the reads/writes are done. This function does
+    /// not require that there actually is any data available for reading or
+    /// that data can be written, it can be called just in case. It will return
+    /// the number of handles that still transfer data.
+    ///
+    /// If the amount of running handles is changed from the previous call (or
+    /// is less than the amount of easy handles you've added to the multi
+    /// handle), you know that there is one or more transfers less "running".
+    /// You can then call `info` to get information about each individual
+    /// completed transfer, and that returned info includes `Error` and more.
+    /// If an added handle fails very quickly, it may never be counted as a
+    /// running handle.
+    ///
+    /// When running_handles is set to zero (0) on the return of this function,
+    /// there is no longer any transfers in progress.
+    ///
+    /// # Return
+    ///
+    /// Before libcurl version 7.20.0: If you receive `is_call_perform`, this
+    /// basically means that you should call `perform` again, before you select
+    /// on more actions. You don't have to do it immediately, but the return
+    /// code means that libcurl may have more data available to return or that
+    /// there may be more data to send off before it is "satisfied". Do note
+    /// that `perform` will return `is_call_perform` only when it wants to be
+    /// called again immediately. When things are fine and there is nothing
+    /// immediate it wants done, it'll return `Ok` and you need to wait for
+    /// "action" and then call this function again.
+    ///
+    /// This function only returns errors etc regarding the whole multi stack.
+    /// Problems still might have occurred on individual transfers even when
+    /// this function returns `Ok`. Use `info` to figure out how individual
+    /// transfers did.
+    pub fn perform(&self) -> Result<u32, MultiError> {
+        unsafe {
+            let mut ret = 0;
+            cvt(curl_sys::curl_multi_perform(self.raw.handle, &mut ret))?;
+            Ok(ret as u32)
+        }
+    }
+
+    /// Extracts file descriptor information from a multi handle
+    ///
+    /// This function extracts file descriptor information from a given
+    /// handle, and libcurl returns its `fd_set` sets. The application can use
+    /// these to `select()` on, but be sure to `FD_ZERO` them before calling
+    /// this function as curl_multi_fdset only adds its own descriptors, it
+    /// doesn't zero or otherwise remove any others. The curl_multi_perform
+    /// function should be called as soon as one of them is ready to be read
+    /// from or written to.
+    ///
+    /// If no file descriptors are set by libcurl, this function will return
+    /// `Ok(None)`. Otherwise `Ok(Some(n))` will be returned where `n` the
+    /// highest descriptor number libcurl set. When `Ok(None)` is returned it
+    /// is because libcurl currently does something that isn't possible for
+    /// your application to monitor with a socket and unfortunately you can
+    /// then not know exactly when the current action is completed using
+    /// `select()`. You then need to wait a while before you proceed and call
+    /// `perform` anyway.
+    ///
+    /// When doing `select()`, you should use `get_timeout` to figure out
+    /// how long to wait for action. Call `perform` even if no activity has
+    /// been seen on the `fd_set`s after the timeout expires as otherwise
+    /// internal retries and timeouts may not work as you'd think and want.
+    ///
+    /// If one of the sockets used by libcurl happens to be larger than what
+    /// can be set in an `fd_set`, which on POSIX systems means that the file
+    /// descriptor is larger than `FD_SETSIZE`, then libcurl will try to not
+    /// set it. Setting a too large file descriptor in an `fd_set` implies an out
+    /// of bounds write which can cause crashes, or worse. The effect of NOT
+    /// storing it will possibly save you from the crash, but will make your
+    /// program NOT wait for sockets it should wait for...
+    pub fn fdset2(
+        &self,
+        read: Option<&mut curl_sys::fd_set>,
+        write: Option<&mut curl_sys::fd_set>,
+        except: Option<&mut curl_sys::fd_set>,
+    ) -> Result<Option<i32>, MultiError> {
+        unsafe {
+            let mut ret = 0;
+            let read = read.map(|r| r as *mut _).unwrap_or(ptr::null_mut());
+            let write = write.map(|r| r as *mut _).unwrap_or(ptr::null_mut());
+            let except = except.map(|r| r as *mut _).unwrap_or(ptr::null_mut());
+            cvt(curl_sys::curl_multi_fdset(
+                self.raw.handle,
+                read,
+                write,
+                except,
+                &mut ret,
+            ))?;
+            if ret == -1 {
+                Ok(None)
+            } else {
+                Ok(Some(ret))
+            }
+        }
+    }
+
+    /// Does nothing and returns `Ok(())`. This method remains for backwards
+    /// compatibility.
+    ///
+    /// This method will be changed to take `self` in a future release.
+    #[doc(hidden)]
+    #[deprecated(
+        since = "0.4.30",
+        note = "cannot close safely without consuming self; \
+                will be changed or removed in a future release"
+    )]
+    pub fn close(&self) -> Result<(), MultiError> {
+        Ok(())
+    }
+
+    /// Get a pointer to the raw underlying CURLM handle.
+    pub fn raw(&self) -> *mut curl_sys::CURLM {
+        self.raw.handle
+    }
+}
+
+impl Drop for RawMulti {
+    fn drop(&mut self) {
+        unsafe {
+            let _ = cvt(curl_sys::curl_multi_cleanup(self.handle));
+        }
+    }
+}
+
+#[cfg(feature = "poll_7_68_0")]
+impl MultiWaker {
+    /// Creates a new MultiWaker handle.
+    fn new(raw: std::sync::Weak<RawMulti>) -> Self {
+        Self { raw }
+    }
+
+    /// Wakes up a thread that is blocked in [Multi::poll]. This method can be
+    /// invoked from any thread.
+    ///
+    /// Will return an error if the RawMulti has already been dropped.
+    ///
+    /// Requires libcurl 7.68.0 or later.
+    pub fn wakeup(&self) -> Result<(), MultiError> {
+        if let Some(raw) = self.raw.upgrade() {
+            unsafe { cvt(curl_sys::curl_multi_wakeup(raw.handle)) }
+        } else {
+            // This happens if the RawMulti has already been dropped:
+            Err(MultiError::new(curl_sys::CURLM_BAD_HANDLE))
+        }
+    }
+}
+
+fn cvt(code: curl_sys::CURLMcode) -> Result<(), MultiError> {
+    if code == curl_sys::CURLM_OK {
+        Ok(())
+    } else {
+        Err(MultiError::new(code))
+    }
+}
+
+impl fmt::Debug for Multi {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("Multi").field("raw", &self.raw).finish()
+    }
+}
+
+macro_rules! impl_easy_getters {
+    () => {
+        impl_easy_getters! {
+            time_condition_unmet -> bool,
+            effective_url -> Option<&str>,
+            effective_url_bytes -> Option<&[u8]>,
+            response_code -> u32,
+            http_connectcode -> u32,
+            filetime -> Option<i64>,
+            download_size -> f64,
+            content_length_download -> f64,
+            total_time -> Duration,
+            namelookup_time -> Duration,
+            connect_time -> Duration,
+            appconnect_time -> Duration,
+            pretransfer_time -> Duration,
+            starttransfer_time -> Duration,
+            redirect_time -> Duration,
+            redirect_count -> u32,
+            redirect_url -> Option<&str>,
+            redirect_url_bytes -> Option<&[u8]>,
+            header_size -> u64,
+            request_size -> u64,
+            content_type -> Option<&str>,
+            content_type_bytes -> Option<&[u8]>,
+            os_errno -> i32,
+            primary_ip -> Option<&str>,
+            primary_port -> u16,
+            local_ip -> Option<&str>,
+            local_port -> u16,
+            cookies -> List,
+        }
+    };
+
+    ($($name:ident -> $ret:ty,)*) => {
+        $(
+            impl_easy_getters!($name, $ret, concat!(
+                "Same as [`Easy2::",
+                stringify!($name),
+                "`](../easy/struct.Easy2.html#method.",
+                stringify!($name),
+                ")."
+            ));
+        )*
+    };
+
+    ($name:ident, $ret:ty, $doc:expr) => {
+        #[doc = $doc]
+        pub fn $name(&mut self) -> Result<$ret, Error> {
+            self.easy.$name()
+        }
+    };
+}
+
+impl EasyHandle {
+    /// Sets an internal private token for this `EasyHandle`.
+    ///
+    /// This function will set the `CURLOPT_PRIVATE` field on the underlying
+    /// easy handle.
+    pub fn set_token(&mut self, token: usize) -> Result<(), Error> {
+        unsafe {
+            crate::cvt(curl_sys::curl_easy_setopt(
+                self.easy.raw(),
+                curl_sys::CURLOPT_PRIVATE,
+                token,
+            ))
+        }
+    }
+
+    impl_easy_getters!();
+
+    /// Unpause reading on a connection.
+    ///
+    /// Using this function, you can explicitly unpause a connection that was
+    /// previously paused.
+    ///
+    /// A connection can be paused by letting the read or the write callbacks
+    /// return `ReadError::Pause` or `WriteError::Pause`.
+    ///
+    /// The chance is high that you will get your write callback called before
+    /// this function returns.
+    pub fn unpause_read(&self) -> Result<(), Error> {
+        self.easy.unpause_read()
+    }
+
+    /// Unpause writing on a connection.
+    ///
+    /// Using this function, you can explicitly unpause a connection that was
+    /// previously paused.
+    ///
+    /// A connection can be paused by letting the read or the write callbacks
+    /// return `ReadError::Pause` or `WriteError::Pause`. A write callback that
+    /// returns pause signals to the library that it couldn't take care of any
+    /// data at all, and that data will then be delivered again to the callback
+    /// when the writing is later unpaused.
+    pub fn unpause_write(&self) -> Result<(), Error> {
+        self.easy.unpause_write()
+    }
+
+    /// Get a pointer to the raw underlying CURL handle.
+    pub fn raw(&self) -> *mut curl_sys::CURL {
+        self.easy.raw()
+    }
+}
+
+impl fmt::Debug for EasyHandle {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.easy.fmt(f)
+    }
+}
+
+impl<H> Easy2Handle<H> {
+    /// Acquires a reference to the underlying handler for events.
+    pub fn get_ref(&self) -> &H {
+        self.easy.get_ref()
+    }
+
+    /// Acquires a reference to the underlying handler for events.
+    pub fn get_mut(&mut self) -> &mut H {
+        self.easy.get_mut()
+    }
+
+    /// Same as `EasyHandle::set_token`
+    pub fn set_token(&mut self, token: usize) -> Result<(), Error> {
+        unsafe {
+            crate::cvt(curl_sys::curl_easy_setopt(
+                self.easy.raw(),
+                curl_sys::CURLOPT_PRIVATE,
+                token,
+            ))
+        }
+    }
+
+    impl_easy_getters!();
+
+    /// Unpause reading on a connection.
+    ///
+    /// Using this function, you can explicitly unpause a connection that was
+    /// previously paused.
+    ///
+    /// A connection can be paused by letting the read or the write callbacks
+    /// return `ReadError::Pause` or `WriteError::Pause`.
+    ///
+    /// The chance is high that you will get your write callback called before
+    /// this function returns.
+    pub fn unpause_read(&self) -> Result<(), Error> {
+        self.easy.unpause_read()
+    }
+
+    /// Unpause writing on a connection.
+    ///
+    /// Using this function, you can explicitly unpause a connection that was
+    /// previously paused.
+    ///
+    /// A connection can be paused by letting the read or the write callbacks
+    /// return `ReadError::Pause` or `WriteError::Pause`. A write callback that
+    /// returns pause signals to the library that it couldn't take care of any
+    /// data at all, and that data will then be delivered again to the callback
+    /// when the writing is later unpaused.
+    pub fn unpause_write(&self) -> Result<(), Error> {
+        self.easy.unpause_write()
+    }
+
+    /// Get a pointer to the raw underlying CURL handle.
+    pub fn raw(&self) -> *mut curl_sys::CURL {
+        self.easy.raw()
+    }
+}
+
+impl<H: fmt::Debug> fmt::Debug for Easy2Handle<H> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.easy.fmt(f)
+    }
+}
+
+impl DetachGuard {
+    /// Detach the referenced easy handle from its multi handle manually.
+    /// Subsequent calls to this method will have no effect.
+    fn detach(&mut self) -> Result<(), MultiError> {
+        if !self.easy.is_null() {
+            unsafe {
+                cvt(curl_sys::curl_multi_remove_handle(
+                    self.multi.handle,
+                    self.easy,
+                ))?
+            }
+
+            // Set easy to null to signify that the handle was removed.
+            self.easy = ptr::null_mut();
+        }
+
+        Ok(())
+    }
+}
+
+impl Drop for DetachGuard {
+    fn drop(&mut self) {
+        let _ = self.detach();
+    }
+}
+
+impl<'multi> Message<'multi> {
+    /// If this message indicates that a transfer has finished, returns the
+    /// result of the transfer in `Some`.
+    ///
+    /// If the message doesn't indicate that a transfer has finished, then
+    /// `None` is returned.
+    ///
+    /// Note that the `result*_for` methods below should be preferred as they
+    /// provide better error messages as the associated error data on the
+    /// handle can be associated with the error type.
+    pub fn result(&self) -> Option<Result<(), Error>> {
+        unsafe {
+            if (*self.ptr).msg == curl_sys::CURLMSG_DONE {
+                Some(crate::cvt((*self.ptr).data as curl_sys::CURLcode))
+            } else {
+                None
+            }
+        }
+    }
+
+    /// Same as `result`, except only returns `Some` for the specified handle.
+    ///
+    /// Note that this function produces better error messages than `result` as
+    /// it uses `take_error_buf` to associate error information with the
+    /// returned error.
+    pub fn result_for(&self, handle: &EasyHandle) -> Option<Result<(), Error>> {
+        if !self.is_for(handle) {
+            return None;
+        }
+        let mut err = self.result();
+        if let Some(Err(e)) = &mut err {
+            if let Some(s) = handle.easy.take_error_buf() {
+                e.set_extra(s);
+            }
+        }
+        err
+    }
+
+    /// Same as `result`, except only returns `Some` for the specified handle.
+    ///
+    /// Note that this function produces better error messages than `result` as
+    /// it uses `take_error_buf` to associate error information with the
+    /// returned error.
+    pub fn result_for2<H>(&self, handle: &Easy2Handle<H>) -> Option<Result<(), Error>> {
+        if !self.is_for2(handle) {
+            return None;
+        }
+        let mut err = self.result();
+        if let Some(Err(e)) = &mut err {
+            if let Some(s) = handle.easy.take_error_buf() {
+                e.set_extra(s);
+            }
+        }
+        err
+    }
+
+    /// Returns whether this easy message was for the specified easy handle or
+    /// not.
+    pub fn is_for(&self, handle: &EasyHandle) -> bool {
+        unsafe { (*self.ptr).easy_handle == handle.easy.raw() }
+    }
+
+    /// Same as `is_for`, but for `Easy2Handle`.
+    pub fn is_for2<H>(&self, handle: &Easy2Handle<H>) -> bool {
+        unsafe { (*self.ptr).easy_handle == handle.easy.raw() }
+    }
+
+    /// Returns the token associated with the easy handle that this message
+    /// represents a completion for.
+    ///
+    /// This function will return the token assigned with
+    /// `EasyHandle::set_token`. This reads the `CURLINFO_PRIVATE` field of the
+    /// underlying `*mut CURL`.
+    pub fn token(&self) -> Result<usize, Error> {
+        unsafe {
+            let mut p = 0usize;
+            crate::cvt(curl_sys::curl_easy_getinfo(
+                (*self.ptr).easy_handle,
+                curl_sys::CURLINFO_PRIVATE,
+                &mut p,
+            ))?;
+            Ok(p)
+        }
+    }
+}
+
+impl<'a> fmt::Debug for Message<'a> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("Message").field("ptr", &self.ptr).finish()
+    }
+}
+
+impl Events {
+    /// Creates a new blank event bit mask.
+    pub fn new() -> Events {
+        Events { bits: 0 }
+    }
+
+    /// Set or unset the whether these events indicate that input is ready.
+    pub fn input(&mut self, val: bool) -> &mut Events {
+        self.flag(curl_sys::CURL_CSELECT_IN, val)
+    }
+
+    /// Set or unset the whether these events indicate that output is ready.
+    pub fn output(&mut self, val: bool) -> &mut Events {
+        self.flag(curl_sys::CURL_CSELECT_OUT, val)
+    }
+
+    /// Set or unset the whether these events indicate that an error has
+    /// happened.
+    pub fn error(&mut self, val: bool) -> &mut Events {
+        self.flag(curl_sys::CURL_CSELECT_ERR, val)
+    }
+
+    fn flag(&mut self, flag: c_int, val: bool) -> &mut Events {
+        if val {
+            self.bits |= flag;
+        } else {
+            self.bits &= !flag;
+        }
+        self
+    }
+}
+
+impl fmt::Debug for Events {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("Events")
+            .field("input", &(self.bits & curl_sys::CURL_CSELECT_IN != 0))
+            .field("output", &(self.bits & curl_sys::CURL_CSELECT_OUT != 0))
+            .field("error", &(self.bits & curl_sys::CURL_CSELECT_ERR != 0))
+            .finish()
+    }
+}
+
+impl SocketEvents {
+    /// Wait for incoming data. For the socket to become readable.
+    pub fn input(&self) -> bool {
+        self.bits & curl_sys::CURL_POLL_IN == curl_sys::CURL_POLL_IN
+    }
+
+    /// Wait for outgoing data. For the socket to become writable.
+    pub fn output(&self) -> bool {
+        self.bits & curl_sys::CURL_POLL_OUT == curl_sys::CURL_POLL_OUT
+    }
+
+    /// Wait for incoming and outgoing data. For the socket to become readable
+    /// or writable.
+    pub fn input_and_output(&self) -> bool {
+        self.bits & curl_sys::CURL_POLL_INOUT == curl_sys::CURL_POLL_INOUT
+    }
+
+    /// The specified socket/file descriptor is no longer used by libcurl.
+    pub fn remove(&self) -> bool {
+        self.bits & curl_sys::CURL_POLL_REMOVE == curl_sys::CURL_POLL_REMOVE
+    }
+}
+
+impl fmt::Debug for SocketEvents {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("Events")
+            .field("input", &self.input())
+            .field("output", &self.output())
+            .field("remove", &self.remove())
+            .finish()
+    }
+}
+
+impl WaitFd {
+    /// Constructs an empty (invalid) WaitFd.
+    pub fn new() -> WaitFd {
+        WaitFd {
+            inner: curl_sys::curl_waitfd {
+                fd: 0,
+                events: 0,
+                revents: 0,
+            },
+        }
+    }
+
+    /// Set the file descriptor to wait for.
+    pub fn set_fd(&mut self, fd: Socket) {
+        self.inner.fd = fd;
+    }
+
+    /// Indicate that the socket should poll on read events such as new data
+    /// received.
+    ///
+    /// Corresponds to `CURL_WAIT_POLLIN`.
+    pub fn poll_on_read(&mut self, val: bool) -> &mut WaitFd {
+        self.flag(curl_sys::CURL_WAIT_POLLIN, val)
+    }
+
+    /// Indicate that the socket should poll on high priority read events such
+    /// as out of band data.
+    ///
+    /// Corresponds to `CURL_WAIT_POLLPRI`.
+    pub fn poll_on_priority_read(&mut self, val: bool) -> &mut WaitFd {
+        self.flag(curl_sys::CURL_WAIT_POLLPRI, val)
+    }
+
+    /// Indicate that the socket should poll on write events such as the socket
+    /// being clear to write without blocking.
+    ///
+    /// Corresponds to `CURL_WAIT_POLLOUT`.
+    pub fn poll_on_write(&mut self, val: bool) -> &mut WaitFd {
+        self.flag(curl_sys::CURL_WAIT_POLLOUT, val)
+    }
+
+    fn flag(&mut self, flag: c_short, val: bool) -> &mut WaitFd {
+        if val {
+            self.inner.events |= flag;
+        } else {
+            self.inner.events &= !flag;
+        }
+        self
+    }
+
+    /// After a call to `wait`, returns `true` if `poll_on_read` was set and a
+    /// read event occured.
+    pub fn received_read(&self) -> bool {
+        self.inner.revents & curl_sys::CURL_WAIT_POLLIN == curl_sys::CURL_WAIT_POLLIN
+    }
+
+    /// After a call to `wait`, returns `true` if `poll_on_priority_read` was set and a
+    /// priority read event occured.
+    pub fn received_priority_read(&self) -> bool {
+        self.inner.revents & curl_sys::CURL_WAIT_POLLPRI == curl_sys::CURL_WAIT_POLLPRI
+    }
+
+    /// After a call to `wait`, returns `true` if `poll_on_write` was set and a
+    /// write event occured.
+    pub fn received_write(&self) -> bool {
+        self.inner.revents & curl_sys::CURL_WAIT_POLLOUT == curl_sys::CURL_WAIT_POLLOUT
+    }
+}
+
+#[cfg(unix)]
+impl From<pollfd> for WaitFd {
+    fn from(pfd: pollfd) -> WaitFd {
+        let mut events = 0;
+        if pfd.events & POLLIN == POLLIN {
+            events |= curl_sys::CURL_WAIT_POLLIN;
+        }
+        if pfd.events & POLLPRI == POLLPRI {
+            events |= curl_sys::CURL_WAIT_POLLPRI;
+        }
+        if pfd.events & POLLOUT == POLLOUT {
+            events |= curl_sys::CURL_WAIT_POLLOUT;
+        }
+        WaitFd {
+            inner: curl_sys::curl_waitfd {
+                fd: pfd.fd,
+                events,
+                revents: 0,
+            },
+        }
+    }
+}
+
+impl fmt::Debug for WaitFd {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("WaitFd")
+            .field("fd", &self.inner.fd)
+            .field("events", &self.inner.fd)
+            .field("revents", &self.inner.fd)
+            .finish()
+    }
+}
+
\ No newline at end of file diff --git a/src/curl/panic.rs.html b/src/curl/panic.rs.html new file mode 100644 index 000000000..d345eeec9 --- /dev/null +++ b/src/curl/panic.rs.html @@ -0,0 +1,70 @@ +panic.rs - source +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
use std::any::Any;
+use std::cell::RefCell;
+use std::panic::{self, AssertUnwindSafe};
+
+thread_local!(static LAST_ERROR: RefCell<Option<Box<dyn Any + Send>>> = {
+    RefCell::new(None)
+});
+
+pub fn catch<T, F: FnOnce() -> T>(f: F) -> Option<T> {
+    match LAST_ERROR.try_with(|slot| slot.borrow().is_some()) {
+        Ok(true) => return None,
+        Ok(false) => {}
+        // we're in thread shutdown, so we're for sure not panicking and
+        // panicking again will abort, so no need to worry!
+        Err(_) => {}
+    }
+
+    // Note that `AssertUnwindSafe` is used here as we prevent reentering
+    // arbitrary code due to the `LAST_ERROR` check above plus propagation of a
+    // panic after we return back to user code from C.
+    match panic::catch_unwind(AssertUnwindSafe(f)) {
+        Ok(ret) => Some(ret),
+        Err(e) => {
+            LAST_ERROR.with(|slot| *slot.borrow_mut() = Some(e));
+            None
+        }
+    }
+}
+
+pub fn propagate() {
+    if let Ok(Some(t)) = LAST_ERROR.try_with(|slot| slot.borrow_mut().take()) {
+        panic::resume_unwind(t)
+    }
+}
+
\ No newline at end of file diff --git a/src/curl/version.rs.html b/src/curl/version.rs.html new file mode 100644 index 000000000..66fafed63 --- /dev/null +++ b/src/curl/version.rs.html @@ -0,0 +1,1016 @@ +version.rs - source +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+
use std::ffi::CStr;
+use std::fmt;
+use std::str;
+
+use libc::{c_char, c_int};
+
+/// Version information about libcurl and the capabilities that it supports.
+pub struct Version {
+    inner: *mut curl_sys::curl_version_info_data,
+}
+
+unsafe impl Send for Version {}
+unsafe impl Sync for Version {}
+
+/// An iterator over the list of protocols a version supports.
+#[derive(Clone)]
+pub struct Protocols<'a> {
+    cur: *const *const c_char,
+    _inner: &'a Version,
+}
+
+impl Version {
+    /// Returns the libcurl version that this library is currently linked against.
+    pub fn num() -> &'static str {
+        unsafe {
+            let s = CStr::from_ptr(curl_sys::curl_version() as *const _);
+            str::from_utf8(s.to_bytes()).unwrap()
+        }
+    }
+
+    /// Returns the libcurl version that this library is currently linked against.
+    pub fn get() -> Version {
+        unsafe {
+            let ptr = curl_sys::curl_version_info(curl_sys::CURLVERSION_NOW);
+            assert!(!ptr.is_null());
+            Version { inner: ptr }
+        }
+    }
+
+    /// Returns the human readable version string,
+    pub fn version(&self) -> &str {
+        unsafe { crate::opt_str((*self.inner).version).unwrap() }
+    }
+
+    /// Returns a numeric representation of the version number
+    ///
+    /// This is a 24 bit number made up of the major number, minor, and then
+    /// patch number. For example 7.9.8 will return 0x070908.
+    pub fn version_num(&self) -> u32 {
+        unsafe { (*self.inner).version_num as u32 }
+    }
+
+    /// Returns true if this was built with the vendored version of libcurl.
+    pub fn vendored(&self) -> bool {
+        curl_sys::vendored()
+    }
+
+    /// Returns a human readable string of the host libcurl is built for.
+    ///
+    /// This is discovered as part of the build environment.
+    pub fn host(&self) -> &str {
+        unsafe { crate::opt_str((*self.inner).host).unwrap() }
+    }
+
+    /// Returns whether libcurl supports IPv6
+    pub fn feature_ipv6(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_IPV6)
+    }
+
+    /// Returns whether libcurl supports SSL
+    pub fn feature_ssl(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_SSL)
+    }
+
+    /// Returns whether libcurl supports HTTP deflate via libz
+    pub fn feature_libz(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_LIBZ)
+    }
+
+    /// Returns whether libcurl supports HTTP NTLM
+    pub fn feature_ntlm(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_NTLM)
+    }
+
+    /// Returns whether libcurl supports HTTP GSSNEGOTIATE
+    pub fn feature_gss_negotiate(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_GSSNEGOTIATE)
+    }
+
+    /// Returns whether libcurl was built with debug capabilities
+    pub fn feature_debug(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_DEBUG)
+    }
+
+    /// Returns whether libcurl was built with SPNEGO authentication
+    pub fn feature_spnego(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_SPNEGO)
+    }
+
+    /// Returns whether libcurl was built with large file support
+    pub fn feature_largefile(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_LARGEFILE)
+    }
+
+    /// Returns whether libcurl was built with support for IDNA, domain names
+    /// with international letters.
+    pub fn feature_idn(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_IDN)
+    }
+
+    /// Returns whether libcurl was built with support for SSPI.
+    pub fn feature_sspi(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_SSPI)
+    }
+
+    /// Returns whether libcurl was built with asynchronous name lookups.
+    pub fn feature_async_dns(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_ASYNCHDNS)
+    }
+
+    /// Returns whether libcurl was built with support for character
+    /// conversions.
+    pub fn feature_conv(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_CONV)
+    }
+
+    /// Returns whether libcurl was built with support for TLS-SRP.
+    pub fn feature_tlsauth_srp(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_TLSAUTH_SRP)
+    }
+
+    /// Returns whether libcurl was built with support for NTLM delegation to
+    /// winbind helper.
+    pub fn feature_ntlm_wb(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_NTLM_WB)
+    }
+
+    /// Returns whether libcurl was built with support for unix domain socket
+    pub fn feature_unix_domain_socket(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_UNIX_SOCKETS)
+    }
+
+    /// Returns whether libcurl was built with support for HTTPS proxy.
+    pub fn feature_https_proxy(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_HTTPS_PROXY)
+    }
+
+    /// Returns whether libcurl was built with support for HTTP2.
+    pub fn feature_http2(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_HTTP2)
+    }
+
+    /// Returns whether libcurl was built with support for HTTP3.
+    pub fn feature_http3(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_HTTP3)
+    }
+
+    /// Returns whether libcurl was built with support for Brotli.
+    pub fn feature_brotli(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_BROTLI)
+    }
+
+    /// Returns whether libcurl was built with support for Alt-Svc.
+    pub fn feature_altsvc(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_ALTSVC)
+    }
+
+    /// Returns whether libcurl was built with support for zstd
+    pub fn feature_zstd(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_ZSTD)
+    }
+
+    /// Returns whether libcurl was built with support for unicode
+    pub fn feature_unicode(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_UNICODE)
+    }
+
+    /// Returns whether libcurl was built with support for hsts
+    pub fn feature_hsts(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_HSTS)
+    }
+
+    /// Returns whether libcurl was built with support for gsasl
+    pub fn feature_gsasl(&self) -> bool {
+        self.flag(curl_sys::CURL_VERSION_GSASL)
+    }
+
+    fn flag(&self, flag: c_int) -> bool {
+        unsafe { (*self.inner).features & flag != 0 }
+    }
+
+    /// Returns the version of OpenSSL that is used, or None if there is no SSL
+    /// support.
+    pub fn ssl_version(&self) -> Option<&str> {
+        unsafe { crate::opt_str((*self.inner).ssl_version) }
+    }
+
+    /// Returns the version of libz that is used, or None if there is no libz
+    /// support.
+    pub fn libz_version(&self) -> Option<&str> {
+        unsafe { crate::opt_str((*self.inner).libz_version) }
+    }
+
+    /// Returns an iterator over the list of protocols that this build of
+    /// libcurl supports.
+    pub fn protocols(&self) -> Protocols {
+        unsafe {
+            Protocols {
+                _inner: self,
+                cur: (*self.inner).protocols,
+            }
+        }
+    }
+
+    /// If available, the human readable version of ares that libcurl is linked
+    /// against.
+    pub fn ares_version(&self) -> Option<&str> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_SECOND {
+                crate::opt_str((*self.inner).ares)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the version of ares that libcurl is linked against.
+    pub fn ares_version_num(&self) -> Option<u32> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_SECOND {
+                Some((*self.inner).ares_num as u32)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the version of libidn that libcurl is linked against.
+    pub fn libidn_version(&self) -> Option<&str> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_THIRD {
+                crate::opt_str((*self.inner).libidn)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the version of iconv libcurl is linked against.
+    pub fn iconv_version_num(&self) -> Option<u32> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_FOURTH {
+                Some((*self.inner).iconv_ver_num as u32)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the version of libssh that libcurl is linked against.
+    pub fn libssh_version(&self) -> Option<&str> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_FOURTH {
+                crate::opt_str((*self.inner).libssh_version)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the version of brotli libcurl is linked against.
+    pub fn brotli_version_num(&self) -> Option<u32> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_FIFTH {
+                Some((*self.inner).brotli_ver_num)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the version of brotli libcurl is linked against.
+    pub fn brotli_version(&self) -> Option<&str> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_FIFTH {
+                crate::opt_str((*self.inner).brotli_version)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the version of nghttp2 libcurl is linked against.
+    pub fn nghttp2_version_num(&self) -> Option<u32> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_SIXTH {
+                Some((*self.inner).nghttp2_ver_num)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the version of nghttp2 libcurl is linked against.
+    pub fn nghttp2_version(&self) -> Option<&str> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_SIXTH {
+                crate::opt_str((*self.inner).nghttp2_version)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the version of quic libcurl is linked against.
+    pub fn quic_version(&self) -> Option<&str> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_SIXTH {
+                crate::opt_str((*self.inner).quic_version)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the built-in default of CURLOPT_CAINFO.
+    pub fn cainfo(&self) -> Option<&str> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_SEVENTH {
+                crate::opt_str((*self.inner).cainfo)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the built-in default of CURLOPT_CAPATH.
+    pub fn capath(&self) -> Option<&str> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_SEVENTH {
+                crate::opt_str((*self.inner).capath)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If avaiable, the numeric zstd version
+    ///
+    /// Represented as `(MAJOR << 24) | (MINOR << 12) | PATCH`
+    pub fn zstd_ver_num(&self) -> Option<u32> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_EIGHTH {
+                Some((*self.inner).zstd_ver_num)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the human readable version of zstd
+    pub fn zstd_version(&self) -> Option<&str> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_EIGHTH {
+                crate::opt_str((*self.inner).zstd_version)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the human readable version of hyper
+    pub fn hyper_version(&self) -> Option<&str> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_NINTH {
+                crate::opt_str((*self.inner).hyper_version)
+            } else {
+                None
+            }
+        }
+    }
+
+    /// If available, the human readable version of hyper
+    pub fn gsasl_version(&self) -> Option<&str> {
+        unsafe {
+            if (*self.inner).age >= curl_sys::CURLVERSION_TENTH {
+                crate::opt_str((*self.inner).gsasl_version)
+            } else {
+                None
+            }
+        }
+    }
+}
+
+impl fmt::Debug for Version {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut f = f.debug_struct("Version");
+        f.field("version", &self.version())
+            .field("rust_crate_version", &env!("CARGO_PKG_VERSION"))
+            .field("rust_sys_crate_version", &curl_sys::rust_crate_version())
+            .field("vendored", &self.vendored())
+            .field("host", &self.host())
+            .field("feature_ipv6", &self.feature_ipv6())
+            .field("feature_ssl", &self.feature_ssl())
+            .field("feature_libz", &self.feature_libz())
+            .field("feature_ntlm", &self.feature_ntlm())
+            .field("feature_gss_negotiate", &self.feature_gss_negotiate())
+            .field("feature_debug", &self.feature_debug())
+            .field("feature_spnego", &self.feature_spnego())
+            .field("feature_largefile", &self.feature_largefile())
+            .field("feature_idn", &self.feature_idn())
+            .field("feature_sspi", &self.feature_sspi())
+            .field("feature_async_dns", &self.feature_async_dns())
+            .field("feature_conv", &self.feature_conv())
+            .field("feature_tlsauth_srp", &self.feature_tlsauth_srp())
+            .field("feature_ntlm_wb", &self.feature_ntlm_wb())
+            .field(
+                "feature_unix_domain_socket",
+                &self.feature_unix_domain_socket(),
+            )
+            .field("feature_https_proxy", &self.feature_https_proxy())
+            .field("feature_altsvc", &self.feature_altsvc())
+            .field("feature_zstd", &self.feature_zstd())
+            .field("feature_unicode", &self.feature_unicode())
+            .field("feature_http3", &self.feature_http3())
+            .field("feature_http2", &self.feature_http2())
+            .field("feature_gsasl", &self.feature_gsasl())
+            .field("feature_brotli", &self.feature_brotli());
+
+        if let Some(s) = self.ssl_version() {
+            f.field("ssl_version", &s);
+        }
+        if let Some(s) = self.libz_version() {
+            f.field("libz_version", &s);
+        }
+        if let Some(s) = self.ares_version() {
+            f.field("ares_version", &s);
+        }
+        if let Some(s) = self.libidn_version() {
+            f.field("libidn_version", &s);
+        }
+        if let Some(s) = self.iconv_version_num() {
+            f.field("iconv_version_num", &format!("{:x}", s));
+        }
+        if let Some(s) = self.libssh_version() {
+            f.field("libssh_version", &s);
+        }
+        if let Some(s) = self.brotli_version_num() {
+            f.field("brotli_version_num", &format!("{:x}", s));
+        }
+        if let Some(s) = self.brotli_version() {
+            f.field("brotli_version", &s);
+        }
+        if let Some(s) = self.nghttp2_version_num() {
+            f.field("nghttp2_version_num", &format!("{:x}", s));
+        }
+        if let Some(s) = self.nghttp2_version() {
+            f.field("nghttp2_version", &s);
+        }
+        if let Some(s) = self.quic_version() {
+            f.field("quic_version", &s);
+        }
+        if let Some(s) = self.zstd_ver_num() {
+            f.field("zstd_ver_num", &format!("{:x}", s));
+        }
+        if let Some(s) = self.zstd_version() {
+            f.field("zstd_version", &s);
+        }
+        if let Some(s) = self.cainfo() {
+            f.field("cainfo", &s);
+        }
+        if let Some(s) = self.capath() {
+            f.field("capath", &s);
+        }
+        if let Some(s) = self.hyper_version() {
+            f.field("hyper_version", &s);
+        }
+        if let Some(s) = self.gsasl_version() {
+            f.field("gsasl_version", &s);
+        }
+
+        f.field("protocols", &self.protocols().collect::<Vec<_>>());
+
+        f.finish()
+    }
+}
+
+impl<'a> Iterator for Protocols<'a> {
+    type Item = &'a str;
+
+    fn next(&mut self) -> Option<&'a str> {
+        unsafe {
+            if (*self.cur).is_null() {
+                return None;
+            }
+            let ret = crate::opt_str(*self.cur).unwrap();
+            self.cur = self.cur.offset(1);
+            Some(ret)
+        }
+    }
+}
+
+impl<'a> fmt::Debug for Protocols<'a> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_list().entries(self.clone()).finish()
+    }
+}
+
\ No newline at end of file diff --git a/static.files/COPYRIGHT-23e9bde6c69aea69.txt b/static.files/COPYRIGHT-23e9bde6c69aea69.txt new file mode 100644 index 000000000..1447df792 --- /dev/null +++ b/static.files/COPYRIGHT-23e9bde6c69aea69.txt @@ -0,0 +1,50 @@ +# REUSE-IgnoreStart + +These documentation pages include resources by third parties. This copyright +file applies only to those resources. The following third party resources are +included, and carry their own copyright notices and license terms: + +* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2): + + Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ + with Reserved Font Name Fira Sans. + + Copyright (c) 2014, Telefonica S.A. + + Licensed under the SIL Open Font License, Version 1.1. + See FiraSans-LICENSE.txt. + +* rustdoc.css, main.js, and playpen.js: + + Copyright 2015 The Rust Developers. + Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or + the MIT license (LICENSE-MIT.txt) at your option. + +* normalize.css: + + Copyright (c) Nicolas Gallagher and Jonathan Neal. + Licensed under the MIT license (see LICENSE-MIT.txt). + +* Source Code Pro (SourceCodePro-Regular.ttf.woff2, + SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2): + + Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark + of Adobe Systems Incorporated in the United States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceCodePro-LICENSE.txt. + +* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2, + SourceSerif4-It.ttf.woff2): + + Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name + 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United + States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceSerif4-LICENSE.md. + +This copyright file is intended to be distributed with rustdoc output. + +# REUSE-IgnoreEnd diff --git a/static.files/FiraSans-LICENSE-db4b642586e02d97.txt b/static.files/FiraSans-LICENSE-db4b642586e02d97.txt new file mode 100644 index 000000000..d7e9c149b --- /dev/null +++ b/static.files/FiraSans-LICENSE-db4b642586e02d97.txt @@ -0,0 +1,98 @@ +// REUSE-IgnoreStart + +Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. +with Reserved Font Name < Fira >, + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 b/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 new file mode 100644 index 000000000..7a1e5fc54 Binary files /dev/null and b/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 differ diff --git a/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 b/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 new file mode 100644 index 000000000..e766e06cc Binary files /dev/null and b/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 differ diff --git a/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt b/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/static.files/LICENSE-MIT-65090b722b3f6c56.txt b/static.files/LICENSE-MIT-65090b722b3f6c56.txt new file mode 100644 index 000000000..31aa79387 --- /dev/null +++ b/static.files/LICENSE-MIT-65090b722b3f6c56.txt @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 b/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 new file mode 100644 index 000000000..1866ad4bc Binary files /dev/null and b/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 differ diff --git a/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt b/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt new file mode 100644 index 000000000..4b3edc29e --- /dev/null +++ b/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt @@ -0,0 +1,103 @@ +// REUSE-IgnoreStart + +Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/), + +with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic, +NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver NanumBrush, NanumPen, +Naver NanumPen, Naver NanumGothicEco, NanumGothicEco, Naver NanumMyeongjoEco, +NanumMyeongjoEco, Naver NanumGothicLight, NanumGothicLight, NanumBarunGothic, +Naver NanumBarunGothic, NanumSquareRound, NanumBarunPen, MaruBuri + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 b/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 new file mode 100644 index 000000000..462c34efc Binary files /dev/null and b/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 differ diff --git a/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt b/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt new file mode 100644 index 000000000..0d2941e14 --- /dev/null +++ b/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt @@ -0,0 +1,97 @@ +// REUSE-IgnoreStart + +Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 b/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 new file mode 100644 index 000000000..10b558e0b Binary files /dev/null and b/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 differ diff --git a/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 b/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 new file mode 100644 index 000000000..5ec64eef0 Binary files /dev/null and b/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 differ diff --git a/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 b/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 new file mode 100644 index 000000000..181a07f63 Binary files /dev/null and b/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 differ diff --git a/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 b/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 new file mode 100644 index 000000000..2ae08a7be Binary files /dev/null and b/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 differ diff --git a/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md b/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md new file mode 100644 index 000000000..175fa4f47 --- /dev/null +++ b/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md @@ -0,0 +1,98 @@ + + +Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. +Copyright 2014 - 2023 Adobe (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + + diff --git a/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 b/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 new file mode 100644 index 000000000..0263fc304 Binary files /dev/null and b/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 differ diff --git a/static.files/clipboard-7571035ce49a181d.svg b/static.files/clipboard-7571035ce49a181d.svg new file mode 100644 index 000000000..8adbd9963 --- /dev/null +++ b/static.files/clipboard-7571035ce49a181d.svg @@ -0,0 +1 @@ + diff --git a/static.files/favicon-16x16-8b506e7a72182f1c.png b/static.files/favicon-16x16-8b506e7a72182f1c.png new file mode 100644 index 000000000..ea4b45cae Binary files /dev/null and b/static.files/favicon-16x16-8b506e7a72182f1c.png differ diff --git a/static.files/favicon-2c020d218678b618.svg b/static.files/favicon-2c020d218678b618.svg new file mode 100644 index 000000000..8b34b5119 --- /dev/null +++ b/static.files/favicon-2c020d218678b618.svg @@ -0,0 +1,24 @@ + + + + + diff --git a/static.files/favicon-32x32-422f7d1d52889060.png b/static.files/favicon-32x32-422f7d1d52889060.png new file mode 100644 index 000000000..69b8613ce Binary files /dev/null and b/static.files/favicon-32x32-422f7d1d52889060.png differ diff --git a/static.files/main-305769736d49e732.js b/static.files/main-305769736d49e732.js new file mode 100644 index 000000000..b8b91afa0 --- /dev/null +++ b/static.files/main-305769736d49e732.js @@ -0,0 +1,11 @@ +"use strict";window.RUSTDOC_TOOLTIP_HOVER_MS=300;window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS=450;function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden")}function showMain(){removeClass(document.getElementById(MAIN_ID),"hidden")}function blurHandler(event,parentElem,hideCallback){if(!parentElem.contains(document.activeElement)&&!parentElem.contains(event.relatedTarget)){hideCallback()}}window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate");function setMobileTopbar(){const mobileTopbar=document.querySelector(".mobile-topbar");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileTopbar){const mobileTitle=document.createElement("h2");mobileTitle.className="location";if(hasClass(document.querySelector(".rustdoc"),"crate")){mobileTitle.innerText=`Crate ${window.currentCrate}`}else if(locationTitle){mobileTitle.innerHTML=locationTitle.innerHTML}mobileTopbar.appendChild(mobileTitle)}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url){const script=document.createElement("script");script.src=url;document.head.append(script)}getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadScript(getVar("static-root-path")+getVar("settings-js"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},removeQueryParameters:()=>{document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},hideResults:()=>{switchDisplayedElement(null);searchState.removeQueryParameters()},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(getVar("static-root-path")+getVar("search-js"));loadScript(resourcePath("search-index",".js"))}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search)},};const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}const pageId=window.location.hash.replace(/^#/,"");if(savedHash!==pageId){savedHash=pageId;if(pageId!==""){expandSection(pageId)}}if(savedHash.startsWith("impl-")){const splitAt=savedHash.indexOf("/");if(splitAt!==-1){const implId=savedHash.slice(0,splitAt);const assocId=savedHash.slice(splitAt+1);const implElem=document.getElementById(implId);if(implElem&&implElem.parentElement.tagName==="SUMMARY"&&implElem.parentElement.parentElement.tagName==="DETAILS"){onEachLazy(implElem.parentElement.parentElement.querySelectorAll(`[id^="${assocId}"]`),item=>{const numbered=/([^-]+)-([0-9]+)/.exec(item.id);if(item.id===assocId||(numbered&&numbered[1]===assocId)){openParentDetails(item);item.scrollIntoView();setTimeout(()=>{window.location.replace("#"+item.id)},0)}})}}}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();searchState.hideResults();ev.preventDefault();searchState.defocus();window.hideAllModals(true)}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"&&document.activeElement.type!=="radio"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":ev.preventDefault();searchState.focus();break;case"+":ev.preventDefault();expandAllDocs();break;case"-":ev.preventDefault();collapseAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementsByClassName("sidebar-elems")[0];function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const modpath=hasClass(document.querySelector(".rustdoc"),"mod")?"../":"";const h3=document.createElement("h3");h3.innerHTML=`${longty}`;const ul=document.createElement("ul");ul.className="block "+shortty;for(const name of filtered){let path;if(shortty==="mod"){path=`${modpath}${name}/index.html`}else{path=`${modpath}${shortty}.${name}.html`}let current_page=document.location.href.toString();if(current_page.endsWith("/")){current_page+="index.html"}const link=document.createElement("a");link.href=path;if(path===current_page){link.className="current"}link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(h3);sidebar.appendChild(ul)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Aliases");block("union","unions","Unions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("opaque","opaque-types","Opaque Types");block("attr","attributes","Attribute Macros");block("derive","derives","Derive Macros");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector(".main-heading h1 > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=new Set((script?script.getAttribute("data-ignore-extern-crates"):"").split(","));for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.has(lib)){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}window.register_type_impls=imp=>{if(!imp||!imp[window.currentCrate]){return}window.pending_type_impls=null;const idMap=new Map();let implementations=document.getElementById("implementations-list");let trait_implementations=document.getElementById("trait-implementations-list");let trait_implementations_header=document.getElementById("trait-implementations");const script=document.querySelector("script[data-self-path]");const selfPath=script?script.getAttribute("data-self-path"):null;const mainContent=document.querySelector("#main-content");const sidebarSection=document.querySelector(".sidebar section");let methods=document.querySelector(".sidebar .block.method");let associatedTypes=document.querySelector(".sidebar .block.associatedtype");let associatedConstants=document.querySelector(".sidebar .block.associatedconstant");let sidebarTraitList=document.querySelector(".sidebar .block.trait-implementation");for(const impList of imp[window.currentCrate]){const types=impList.slice(2);const text=impList[0];const isTrait=impList[1]!==0;const traitName=impList[1];if(types.indexOf(selfPath)===-1){continue}let outputList=isTrait?trait_implementations:implementations;if(outputList===null){const outputListName=isTrait?"Trait Implementations":"Implementations";const outputListId=isTrait?"trait-implementations-list":"implementations-list";const outputListHeaderId=isTrait?"trait-implementations":"implementations";const outputListHeader=document.createElement("h2");outputListHeader.id=outputListHeaderId;outputListHeader.innerText=outputListName;outputList=document.createElement("div");outputList.id=outputListId;if(isTrait){const link=document.createElement("a");link.href=`#${outputListHeaderId}`;link.innerText="Trait Implementations";const h=document.createElement("h3");h.appendChild(link);trait_implementations=outputList;trait_implementations_header=outputListHeader;sidebarSection.appendChild(h);sidebarTraitList=document.createElement("ul");sidebarTraitList.className="block trait-implementation";sidebarSection.appendChild(sidebarTraitList);mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}else{implementations=outputList;if(trait_implementations){mainContent.insertBefore(outputListHeader,trait_implementations_header);mainContent.insertBefore(outputList,trait_implementations_header)}else{const mainContent=document.querySelector("#main-content");mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}}}const template=document.createElement("template");template.innerHTML=text;onEachLazy(template.content.querySelectorAll("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});onEachLazy(template.content.querySelectorAll("[id]"),el=>{let i=0;if(idMap.has(el.id)){i=idMap.get(el.id)}else if(document.getElementById(el.id)){i=1;while(document.getElementById(`${el.id}-${2 * i}`)){i=2*i}while(document.getElementById(`${el.id}-${i}`)){i+=1}}if(i!==0){const oldHref=`#${el.id}`;const newHref=`#${el.id}-${i}`;el.id=`${el.id}-${i}`;onEachLazy(template.content.querySelectorAll("a[href]"),link=>{if(link.getAttribute("href")===oldHref){link.href=newHref}})}idMap.set(el.id,i+1)});const templateAssocItems=template.content.querySelectorAll("section.tymethod, "+"section.method, section.associatedtype, section.associatedconstant");if(isTrait){const li=document.createElement("li");const a=document.createElement("a");a.href=`#${template.content.querySelector(".impl").id}`;a.textContent=traitName;li.appendChild(a);sidebarTraitList.append(li)}else{onEachLazy(templateAssocItems,item=>{let block=hasClass(item,"associatedtype")?associatedTypes:(hasClass(item,"associatedconstant")?associatedConstants:(methods));if(!block){const blockTitle=hasClass(item,"associatedtype")?"Associated Types":(hasClass(item,"associatedconstant")?"Associated Constants":("Methods"));const blockClass=hasClass(item,"associatedtype")?"associatedtype":(hasClass(item,"associatedconstant")?"associatedconstant":("method"));const blockHeader=document.createElement("h3");const blockLink=document.createElement("a");blockLink.href="#implementations";blockLink.innerText=blockTitle;blockHeader.appendChild(blockLink);block=document.createElement("ul");block.className=`block ${blockClass}`;const insertionReference=methods||sidebarTraitList;if(insertionReference){const insertionReferenceH=insertionReference.previousElementSibling;sidebarSection.insertBefore(blockHeader,insertionReferenceH);sidebarSection.insertBefore(block,insertionReferenceH)}else{sidebarSection.appendChild(blockHeader);sidebarSection.appendChild(block)}if(hasClass(item,"associatedtype")){associatedTypes=block}else if(hasClass(item,"associatedconstant")){associatedConstants=block}else{methods=block}}const li=document.createElement("li");const a=document.createElement("a");a.innerText=item.id.split("-")[0].split(".")[1];a.href=`#${item.id}`;li.appendChild(a);block.appendChild(li)})}outputList.appendChild(template.content)}for(const list of[methods,associatedTypes,associatedConstants,sidebarTraitList]){if(!list){continue}const newChildren=Array.prototype.slice.call(list.children);newChildren.sort((a,b)=>{const aI=a.innerText;const bI=b.innerText;return aIbI?1:0});list.replaceChildren(...newChildren)}};if(window.pending_type_impls){window.register_type_impls(window.pending_type_impls)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const h3=document.createElement("h3");h3.innerHTML="Crates";const ul=document.createElement("ul");ul.className="block crate";for(const crate of window.ALL_CRATES){const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";link.textContent=crate;const li=document.createElement("li");if(window.rootPath!=="./"&&crate===window.currentCrate){li.className="current"}li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(h3);sidebarElems.appendChild(ul)}function expandAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hasClass(e,"type-contents-toggle")&&!hasClass(e,"more-examples-toggle")){e.open=true}});innerToggle.title="collapse all docs";innerToggle.children[0].innerText="\u2212"}function collapseAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});innerToggle.title="expand all docs";innerToggle.children[0].innerText="+"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){expandAllDocs()}else{collapseAllDocs()}}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}})}());window.rustdoc_add_line_numbers_to_examples=()=>{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");if(line_numbers.length>0){return}const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");for(const node of line_numbers){parent.removeChild(node)}})};if(getSettingValue("line-numbers")==="true"){window.rustdoc_add_line_numbers_to_examples()}function showSidebar(){window.hideAllModals(false);const sidebar=document.getElementsByClassName("sidebar")[0];addClass(sidebar,"shown")}function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}window.addEventListener("resize",()=>{if(window.CURRENT_TOOLTIP_ELEMENT){const base=window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE;const force_visible=base.TOOLTIP_FORCE_VISIBLE;hideTooltip(false);if(force_visible){showTooltip(base);base.TOOLTIP_FORCE_VISIBLE=true}}});const mainElem=document.getElementById(MAIN_ID);if(mainElem){mainElem.addEventListener("click",hideSidebar)}onEachLazy(document.querySelectorAll("a[href^='#']"),el=>{el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})});onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});function showTooltip(e){const notable_ty=e.getAttribute("data-notable-ty");if(!window.NOTABLE_TRAITS&¬able_ty){const data=document.getElementById("notable-traits-data");if(data){window.NOTABLE_TRAITS=JSON.parse(data.innerText)}else{throw new Error("showTooltip() called with notable without any notable traits!")}}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE===e){clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);return}window.hideAllModals(false);const wrapper=document.createElement("div");if(notable_ty){wrapper.innerHTML="
"+window.NOTABLE_TRAITS[notable_ty]+"
"}else{if(e.getAttribute("title")!==null){e.setAttribute("data-title",e.getAttribute("title"));e.removeAttribute("title")}if(e.getAttribute("data-title")!==null){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(e.getAttribute("data-title")));wrapper.appendChild(titleContent)}}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";const body=document.getElementsByTagName("body")[0];body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px")}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);wrapper.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}clearTooltipHoverTimeout(e)};wrapper.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!e.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(wrapper,"fade-out")}}}function setTooltipHoverTimeout(element,show){clearTooltipHoverTimeout(element);if(!show&&!window.CURRENT_TOOLTIP_ELEMENT){return}if(show&&window.CURRENT_TOOLTIP_ELEMENT){return}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE!==element){return}element.TOOLTIP_HOVER_TIMEOUT=setTimeout(()=>{if(show){showTooltip(element)}else if(!element.TOOLTIP_FORCE_VISIBLE){hideTooltip(false)}},show?window.RUSTDOC_TOOLTIP_HOVER_MS:window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS)}function clearTooltipHoverTimeout(element){if(element.TOOLTIP_HOVER_TIMEOUT!==undefined){removeClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out");clearTimeout(element.TOOLTIP_HOVER_TIMEOUT);delete element.TOOLTIP_HOVER_TIMEOUT}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.contains(event.relatedTarget)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(event.relatedTarget)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}const body=document.getElementsByTagName("body")[0];body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=()=>{e.TOOLTIP_FORCE_VISIBLE=e.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!e.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(e);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointermove=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out")}}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");const channel=getVar("channel");book_info.className="top";book_info.innerHTML=`You can find more information in \ +the rustdoc book.`;const shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=[`For a full list of all search features, take a look here.`,"Prefix searches with a type followed by a colon (e.g., fn:) to \ + restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ + enum, trait, type, macro, \ + and const.","Search functions by type signature (e.g., vec -> usize or \ + -> vec or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \ + your request: \"string\"","Look for functions that accept or return \ + slices and \ + arrays by writing \ + square brackets (e.g., -> [u8] or [] -> Option)","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");if(!isHelpPage){container.className="popover"}container.id="help";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);if(isHelpPage){const help_section=document.createElement("section");help_section.appendChild(container);document.getElementById("main-content").appendChild(help_section);container.style.display="block"}else{const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler}return container}window.hideAllModals=switchFocus=>{hideSidebar();window.hidePopoverMenus();hideTooltip(switchFocus)};window.hidePopoverMenus=()=>{onEachLazy(document.querySelectorAll(".search-form .popover"),elem=>{elem.style.display="none"})};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){getHelpButton().querySelector("a").focus();const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hideAllModals();menu.style.display=""}}if(isHelpPage){showHelp();document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault()})}else{document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault();const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}})}setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){const SIDEBAR_MIN=100;const SIDEBAR_MAX=500;const RUSTDOC_MOBILE_BREAKPOINT=700;const BODY_MIN=400;const SIDEBAR_VANISH_THRESHOLD=SIDEBAR_MIN/2;const sidebarButton=document.getElementById("sidebar-button");if(sidebarButton){sidebarButton.addEventListener("click",e=>{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false");e.preventDefault()})}let currentPointerId=null;let desiredSidebarSize=null;let pendingSidebarResizingFrame=false;const resizer=document.querySelector(".sidebar-resizer");const sidebar=document.querySelector(".sidebar");if(!resizer||!sidebar){return}const isSrcPage=hasClass(document.body,"src");function hideSidebar(){if(isSrcPage){window.rustdocCloseSourceSidebar();updateLocalStorage("src-sidebar-width",null);document.documentElement.style.removeProperty("--src-sidebar-width");sidebar.style.removeProperty("--src-sidebar-width");resizer.style.removeProperty("--src-sidebar-width")}else{addClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","true");updateLocalStorage("desktop-sidebar-width",null);document.documentElement.style.removeProperty("--desktop-sidebar-width");sidebar.style.removeProperty("--desktop-sidebar-width");resizer.style.removeProperty("--desktop-sidebar-width")}}function showSidebar(){if(isSrcPage){window.rustdocShowSourceSidebar()}else{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false")}}function changeSidebarSize(size){if(isSrcPage){updateLocalStorage("src-sidebar-width",size);sidebar.style.setProperty("--src-sidebar-width",size+"px");resizer.style.setProperty("--src-sidebar-width",size+"px")}else{updateLocalStorage("desktop-sidebar-width",size);sidebar.style.setProperty("--desktop-sidebar-width",size+"px");resizer.style.setProperty("--desktop-sidebar-width",size+"px")}}function isSidebarHidden(){return isSrcPage?!hasClass(document.documentElement,"src-sidebar-expanded"):hasClass(document.documentElement,"hide-sidebar")}function resize(e){if(currentPointerId===null||currentPointerId!==e.pointerId){return}e.preventDefault();const pos=e.clientX-sidebar.offsetLeft-3;if(pos=SIDEBAR_MIN){if(isSidebarHidden()){showSidebar()}const constrainedPos=Math.min(pos,window.innerWidth-BODY_MIN,SIDEBAR_MAX);changeSidebarSize(constrainedPos);desiredSidebarSize=constrainedPos;if(pendingSidebarResizingFrame!==false){clearTimeout(pendingSidebarResizingFrame)}pendingSidebarResizingFrame=setTimeout(()=>{if(currentPointerId===null||pendingSidebarResizingFrame===false){return}pendingSidebarResizingFrame=false;document.documentElement.style.setProperty("--resizing-sidebar-width",desiredSidebarSize+"px")},100)}}window.addEventListener("resize",()=>{if(window.innerWidth=(window.innerWidth-BODY_MIN)){changeSidebarSize(window.innerWidth-BODY_MIN)}else if(desiredSidebarSize!==null&&desiredSidebarSize>SIDEBAR_MIN){changeSidebarSize(desiredSidebarSize)}});function stopResize(e){if(currentPointerId===null){return}if(e){e.preventDefault()}desiredSidebarSize=sidebar.getBoundingClientRect().width;removeClass(resizer,"active");window.removeEventListener("pointermove",resize,false);window.removeEventListener("pointerup",stopResize,false);removeClass(document.documentElement,"sidebar-resizing");document.documentElement.style.removeProperty("--resizing-sidebar-width");if(resizer.releasePointerCapture){resizer.releasePointerCapture(currentPointerId);currentPointerId=null}}function initResize(e){if(currentPointerId!==null||e.altKey||e.ctrlKey||e.metaKey||e.button!==0){return}if(resizer.setPointerCapture){resizer.setPointerCapture(e.pointerId);if(!resizer.hasPointerCapture(e.pointerId)){resizer.releasePointerCapture(e.pointerId);return}currentPointerId=e.pointerId}e.preventDefault();window.addEventListener("pointermove",resize,false);window.addEventListener("pointercancel",stopResize,false);window.addEventListener("pointerup",stopResize,false);addClass(resizer,"active");addClass(document.documentElement,"sidebar-resizing");const pos=e.clientX-sidebar.offsetLeft-3;document.documentElement.style.setProperty("--resizing-sidebar-width",pos+"px");desiredSidebarSize=null}resizer.addEventListener("pointerdown",initResize,false)}());(function(){let reset_button_timeout=null;const but=document.getElementById("copy-path");if(!but){return}but.onclick=()=>{const parent=but.parentElement;const path=[];onEach(parent.childNodes,child=>{if(child.tagName==="A"){path.push(child.textContent)}});const el=document.createElement("textarea");el.value=path.join("::");el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el);but.children[0].style.display="none";let tmp;if(but.childNodes.length<2){tmp=document.createTextNode("✓");but.appendChild(tmp)}else{onEachLazy(but.childNodes,e=>{if(e.nodeType===Node.TEXT_NODE){tmp=e;return true}});tmp.textContent="✓"}if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){tmp.textContent="";reset_button_timeout=null;but.children[0].style.display=""}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/static.files/normalize-76eba96aa4d2e634.css b/static.files/normalize-76eba96aa4d2e634.css new file mode 100644 index 000000000..469959f13 --- /dev/null +++ b/static.files/normalize-76eba96aa4d2e634.css @@ -0,0 +1,2 @@ + /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} \ No newline at end of file diff --git a/static.files/noscript-feafe1bb7466e4bd.css b/static.files/noscript-feafe1bb7466e4bd.css new file mode 100644 index 000000000..7bbe07f1c --- /dev/null +++ b/static.files/noscript-feafe1bb7466e4bd.css @@ -0,0 +1 @@ + #main-content .attributes{margin-left:0 !important;}#copy-path,#sidebar-button,.sidebar-resizer{display:none;}nav.sub{display:none;}.src .sidebar{display:none;}.notable-traits{display:none;}:root{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);--sidebar-resizer-hover:hsl(207,90%,66%);--sidebar-resizer-active:hsl(207,90%,54%);}@media (prefers-color-scheme:dark){:root{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);--sidebar-resizer-hover:hsl(207,30%,54%);--sidebar-resizer-active:hsl(207,90%,54%);}} \ No newline at end of file diff --git a/static.files/rust-logo-151179464ae7ed46.svg b/static.files/rust-logo-151179464ae7ed46.svg new file mode 100644 index 000000000..62424d8ff --- /dev/null +++ b/static.files/rust-logo-151179464ae7ed46.svg @@ -0,0 +1,61 @@ + + + diff --git a/static.files/rustdoc-ac92e1bbe349e143.css b/static.files/rustdoc-ac92e1bbe349e143.css new file mode 100644 index 000000000..27e3d9d5a --- /dev/null +++ b/static.files/rustdoc-ac92e1bbe349e143.css @@ -0,0 +1,18 @@ + :root{--nav-sub-mobile-padding:8px;--search-typename-width:6.75rem;--desktop-sidebar-width:200px;--src-sidebar-width:300px;--desktop-sidebar-z-index:100;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular-018c141bf0843ffd.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium-8f9a781e4970d388.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular-46f98efaafac5295.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{box-sizing:border-box;}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;font-feature-settings:"kern","liga";background-color:var(--main-background-color);color:var(--main-color);}h1{font-size:1.5rem;}h2{font-size:1.375rem;}h3{font-size:1.25rem;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:25px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}.docblock>h2:first-child,.docblock>h3:first-child,.docblock>h4:first-child,.docblock>h5:first-child,.docblock>h6:first-child{margin-top:0;}.main-heading h1{margin:0;padding:0;flex-grow:1;overflow-wrap:break-word;overflow-wrap:anywhere;}.main-heading{display:flex;flex-wrap:wrap;padding-bottom:6px;margin-bottom:15px;}.content h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h1,h2{line-height:1.25;padding-top:3px;padding-bottom:9px;}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;margin:0;padding:0;white-space:pre-wrap;}#crate-search,h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,.search-input,.search-results .result-name,.item-name>a,.out-of-band,span.since,a.src,#help-button>a,summary.hideme,.scraped-example-list,ul.all-items{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}#toggle-all-docs,a.anchor,.section-header a,#src-sidebar a,.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,h1 a,.search-results a,.stab,.result-name i{color:var(--main-color);}span.enum,a.enum,span.struct,a.struct,span.union,a.union,span.primitive,a.primitive,span.type,a.type,span.foreigntype,a.foreigntype{color:var(--type-link-color);}span.trait,a.trait,span.traitalias,a.traitalias{color:var(--trait-link-color);}span.associatedtype,a.associatedtype,span.constant,a.constant,span.static,a.static{color:var(--assoc-item-link-color);}span.fn,a.fn,span.method,a.method,span.tymethod,a.tymethod{color:var(--function-link-color);}span.attr,a.attr,span.derive,a.derive,span.macro,a.macro{color:var(--macro-link-color);}span.mod,a.mod{color:var(--mod-link-color);}span.keyword,a.keyword{color:var(--keyword-link-color);}a{color:var(--link-color);text-decoration:none;}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p,.docblock>.warning{margin:0 0 .75em 0;}p:last-child,.docblock>.warning:last-child{margin:0;}button{padding:1px 6px;cursor:pointer;}button#toggle-all-docs{padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.src main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}details:not(.toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;line-height:1.5;}pre.item-decl{overflow-x:auto;}.item-decl .type-contents-toggle{contain:initial;}.src .content pre{padding:20px;}.rustdoc.src .example-wrap pre.src-line-numbers{padding:20px 0 20px 4px;}img{max-width:100%;}.sub-logo-container,.logo-container{line-height:0;display:block;}.sub-logo-container{margin-right:32px;}.sub-logo-container>img{height:60px;width:60px;object-fit:contain;}.rust-logo{filter:var(--rust-logo-filter);}.sidebar{font-size:0.875rem;flex:0 0 var(--desktop-sidebar-width);width:var(--desktop-sidebar-width);overflow-y:scroll;overscroll-behavior:contain;position:sticky;height:100vh;top:0;left:0;z-index:var(--desktop-sidebar-z-index);}.rustdoc.src .sidebar{flex-basis:50px;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;}.hide-sidebar .sidebar,.hide-sidebar .sidebar-resizer{display:none;}.sidebar-resizer{touch-action:none;width:9px;cursor:col-resize;z-index:calc(var(--desktop-sidebar-z-index) + 1);position:fixed;height:100%;left:calc(var(--desktop-sidebar-width) + 1px);}.rustdoc.src .sidebar-resizer{left:49px;}.src-sidebar-expanded .rustdoc.src .sidebar-resizer{left:var(--src-sidebar-width);}.sidebar-resizing{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.sidebar-resizing*{cursor:col-resize !important;}.sidebar-resizing .sidebar{position:fixed;}.sidebar-resizing>body{padding-left:var(--resizing-sidebar-width);}.sidebar-resizer:hover,.sidebar-resizer:active,.sidebar-resizer:focus,.sidebar-resizer.active{width:10px;margin:0;left:var(--desktop-sidebar-width);border-left:solid 1px var(--sidebar-resizer-hover);}.src-sidebar-expanded .rustdoc.src .sidebar-resizer:hover,.src-sidebar-expanded .rustdoc.src .sidebar-resizer:active,.src-sidebar-expanded .rustdoc.src .sidebar-resizer:focus,.src-sidebar-expanded .rustdoc.src .sidebar-resizer.active{left:calc(var(--src-sidebar-width) - 1px);}@media (pointer:coarse){.sidebar-resizer{display:none !important;}}.sidebar-resizer.active{padding:0 140px;width:2px;margin-left:-140px;border-left:none;}.sidebar-resizer.active:before{border-left:solid 2px var(--sidebar-resizer-active);display:block;height:100%;content:"";}.sidebar,.mobile-topbar,.sidebar-menu-toggle,#src-sidebar-toggle,#src-sidebar{background-color:var(--sidebar-background-color);}#src-sidebar-toggle>button:hover,#src-sidebar-toggle>button:focus{background-color:var(--sidebar-background-color-hover);}.src .sidebar>*:not(#src-sidebar-toggle){visibility:hidden;}.src-sidebar-expanded .src .sidebar{overflow-y:auto;flex-basis:var(--src-sidebar-width);width:var(--src-sidebar-width);}.src-sidebar-expanded .src .sidebar>*:not(#src-sidebar-toggle){visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;scrollbar-color:var(--scrollbar-color);}.sidebar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color);}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;background-color:var(--scrollbar-track-background-color);}.sidebar::-webkit-scrollbar-track{background-color:var(--scrollbar-track-background-color);}::-webkit-scrollbar-thumb,.sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-background-color);}.hidden{display:none !important;}.logo-container>img{height:48px;width:48px;}ul.block,.block li{padding:0;margin:0;list-style:none;}.sidebar-elems a,.sidebar>h2 a{display:block;padding:0.25rem;margin-left:-0.25rem;margin-right:0.25rem;}.sidebar h2{overflow-wrap:anywhere;padding:0;margin:0.7rem 0;}.sidebar h3{font-size:1.125rem;padding:0;margin:0;}.sidebar-elems,.sidebar>.version,.sidebar>h2{padding-left:24px;}.sidebar a{color:var(--sidebar-link-color);}.sidebar .current,.sidebar .current a,.sidebar-crate a.logo-container:hover+h2 a,.sidebar a:hover:not(.logo-container){background-color:var(--sidebar-current-link-background-color);}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.sidebar-crate{display:flex;align-items:center;justify-content:center;margin:14px 32px 1rem;row-gap:10px;column-gap:32px;flex-wrap:wrap;}.sidebar-crate h2{flex-grow:1;margin:0 -8px;align-self:start;}.sidebar-crate .logo-container{margin:0 -16px 0 -16px;text-align:center;}.sidebar-crate h2 a{display:block;margin:0 calc(-24px + 0.25rem) 0 -0.5rem;padding:calc((16px - 0.57rem ) / 2 ) 0.25rem;padding-left:0.5rem;}.sidebar-crate h2 .version{display:block;font-weight:normal;font-size:1rem;overflow-wrap:break-word;margin-top:calc((-16px + 0.57rem ) / 2 );}.sidebar-crate+.version{margin-top:-1rem;margin-bottom:1rem;}.mobile-topbar{display:none;}.rustdoc .example-wrap{display:flex;position:relative;margin-bottom:10px;}.rustdoc .example-wrap:last-child{margin-bottom:0px;}.rustdoc .example-wrap pre{margin:0;flex-grow:1;}.rustdoc:not(.src) .example-wrap pre{overflow:auto hidden;}.rustdoc .example-wrap pre.example-line-numbers,.rustdoc .example-wrap pre.src-line-numbers{flex-grow:0;min-width:fit-content;overflow:initial;text-align:right;-webkit-user-select:none;user-select:none;padding:14px 8px;color:var(--src-line-numbers-span-color);}.rustdoc .example-wrap pre.src-line-numbers{padding:14px 0;}.src-line-numbers a,.src-line-numbers span{color:var(--src-line-numbers-span-color);padding:0 8px;}.src-line-numbers :target{background-color:transparent;border-right:none;padding:0 8px;}.src-line-numbers .line-highlighted{background-color:var(--src-line-number-highlighted-background-color);}.search-loading{text-align:center;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock :not(pre)>code,.docblock-short code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25rem;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock{margin-left:24px;position:relative;}.docblock>:not(.more-examples-toggle):not(.example-wrap){max-width:100%;overflow-x:auto;}.out-of-band{flex-grow:0;font-size:1.125rem;}.docblock code,.docblock-short code,pre,.rustdoc.src .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}.docblock table{margin:.5em 0;border-collapse:collapse;}.docblock table td,.docblock table th{padding:.5em;border:1px solid var(--border-color);}.docblock table tbody tr:nth-child(2n){background:var(--table-alt-row-background-color);}div.where{white-space:pre-wrap;font-size:0.875rem;}.item-info{display:block;margin-left:24px;}.item-info code{font-size:0.875rem;}#main-content>.item-info{margin-left:0;}nav.sub{flex-grow:1;flex-flow:row nowrap;margin:4px 0 25px 0;display:flex;align-items:center;}.search-form{position:relative;display:flex;height:34px;flex-grow:1;}.src nav.sub{margin:0 0 15px 0;}.section-header{display:block;position:relative;}.section-header:hover>.anchor,.impl:hover>.anchor,.trait-impl:hover>.anchor,.variant:hover>.anchor{display:initial;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.section-header>.anchor{left:-15px;padding-right:8px;}h2.section-header>.anchor{padding-right:6px;}.main-heading a:hover,.example-wrap .rust a:hover,.all-items a:hover,.docblock a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.docblock-short a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.item-info a{text-decoration:underline;}.crate.block li.current a{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;padding:0;margin:0;}.item-table>li{display:table-row;}.item-table>li>div{display:table-cell;}.item-table>li>.item-name{padding-right:1.25rem;}.search-results-title{margin-top:0;white-space:nowrap;display:flex;align-items:baseline;}#crate-search-div{position:relative;min-width:5em;}#crate-search{min-width:115px;padding:0 23px 0 4px;max-width:100%;text-overflow:ellipsis;border:1px solid var(--border-color);border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;background-color:var(--main-background-color);color:inherit;line-height:1.5;font-weight:500;}#crate-search:hover,#crate-search:focus{border-color:var(--crate-search-hover-border);}#crate-search-div::after{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;content:"";background-repeat:no-repeat;background-size:20px;background-position:calc(100% - 2px) 56%;background-image:url('data:image/svg+xml, \ + ');filter:var(--crate-search-div-filter);}#crate-search-div:hover::after,#crate-search-div:focus-within::after{filter:var(--crate-search-div-hover-filter);}#crate-search>option{font-size:1rem;}.search-input{-webkit-appearance:none;outline:none;border:1px solid var(--border-color);border-radius:2px;padding:8px;font-size:1rem;flex-grow:1;background-color:var(--button-background-color);color:var(--search-color);}.search-input:focus{border-color:var(--search-input-focused-border-color);}.search-results{display:none;}.search-results.active{display:block;}.search-results>a{display:flex;margin-left:2px;margin-right:2px;border-bottom:1px solid var(--search-result-border-color);gap:1em;}.search-results>a>div.desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:2;}.search-results a:hover,.search-results a:focus{background-color:var(--search-result-link-focus-background-color);}.search-results .result-name{display:flex;align-items:center;justify-content:start;flex:3;}.search-results .result-name .alias{color:var(--search-results-alias-color);}.search-results .result-name .grey{color:var(--search-results-grey-color);}.search-results .result-name .typename{color:var(--search-results-grey-color);font-size:0.875rem;width:var(--search-typename-width);}.search-results .result-name .path{word-break:break-all;max-width:calc(100% - var(--search-typename-width));display:inline-block;}.search-results .result-name .path>*{display:inline;}.popover{position:absolute;top:100%;right:0;z-index:calc(var(--desktop-sidebar-z-index) + 1);margin-top:7px;border-radius:3px;border:1px solid var(--border-color);background-color:var(--main-background-color);color:var(--main-color);--popover-arrow-offset:11px;}.popover::before{content:'';position:absolute;right:var(--popover-arrow-offset);border:solid var(--border-color);border-width:1px 1px 0 0;background-color:var(--main-background-color);padding:4px;transform:rotate(-45deg);top:-5px;}.setting-line{margin:1.2em 0.6em;}.setting-radio input,.setting-check input{margin-right:0.3em;height:1.2rem;width:1.2rem;border:2px solid var(--settings-input-border-color);outline:none;-webkit-appearance:none;cursor:pointer;}.setting-radio input{border-radius:50%;}.setting-radio span,.setting-check span{padding-bottom:1px;}.setting-radio{margin-top:0.1em;margin-bottom:0.1em;min-width:3.8em;padding:0.3em;display:inline-flex;align-items:center;cursor:pointer;}.setting-radio+.setting-radio{margin-left:0.5em;}.setting-check{margin-right:20px;display:flex;align-items:center;cursor:pointer;}.setting-radio input:checked{box-shadow:inset 0 0 0 3px var(--main-background-color);background-color:var(--settings-input-color);}.setting-check input:checked{background-color:var(--settings-input-color);border-width:1px;content:url('data:image/svg+xml,\ + \ + ');}.setting-radio input:focus,.setting-check input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-radio input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-radio input:hover,.setting-check input:hover{border-color:var(--settings-input-color) !important;}#help.popover{max-width:600px;--popover-arrow-offset:48px;}#help dt{float:left;clear:left;margin-right:0.5rem;}#help span.top,#help span.bottom{text-align:center;display:block;font-size:1.125rem;}#help span.top{margin:10px 0;border-bottom:1px solid var(--border-color);padding-bottom:4px;margin-bottom:6px;}#help span.bottom{clear:both;border-top:1px solid var(--border-color);}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{display:block;padding:3px;margin-bottom:5px;}.item-name .stab{margin-left:0.3125em;}.stab{padding:0 2px;font-size:0.875rem;font-weight:normal;color:var(--main-color);background-color:var(--stab-background-color);width:fit-content;white-space:pre-wrap;border-radius:3px;display:inline;vertical-align:baseline;}.stab.portability>code{background:none;color:var(--stab-code-color);}.stab .emoji,.item-info .stab::before{font-size:1.25rem;}.stab .emoji{margin-right:0.3rem;}.item-info .stab::before{content:"\0";width:0;display:inline-block;color:transparent;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;float:right;}.rightside:not(a),.out-of-band{color:var(--right-side-color);}pre.rust{tab-size:4;-moz-tab-size:4;}pre.rust .kw{color:var(--code-highlight-kw-color);}pre.rust .kw-2{color:var(--code-highlight-kw-2-color);}pre.rust .lifetime{color:var(--code-highlight-lifetime-color);}pre.rust .prelude-ty{color:var(--code-highlight-prelude-color);}pre.rust .prelude-val{color:var(--code-highlight-prelude-val-color);}pre.rust .string{color:var(--code-highlight-string-color);}pre.rust .number{color:var(--code-highlight-number-color);}pre.rust .bool-val{color:var(--code-highlight-literal-color);}pre.rust .self{color:var(--code-highlight-self-color);}pre.rust .attr{color:var(--code-highlight-attribute-color);}pre.rust .macro,pre.rust .macro-nonterminal{color:var(--code-highlight-macro-color);}pre.rust .question-mark{font-weight:bold;color:var(--code-highlight-question-mark-color);}pre.rust .comment{color:var(--code-highlight-comment-color);}pre.rust .doccomment{color:var(--code-highlight-doc-comment-color);}.rustdoc.src .example-wrap pre.rust a{background:var(--codeblock-link-background);}.example-wrap.compile_fail,.example-wrap.should_panic{border-left:2px solid var(--codeblock-error-color);}.ignore.example-wrap{border-left:2px solid var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover,.example-wrap.should_panic:hover{border-left:2px solid var(--codeblock-error-hover-color);}.example-wrap.ignore:hover{border-left:2px solid var(--codeblock-ignore-hover-color);}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip{color:var(--codeblock-error-color);}.example-wrap.ignore .tooltip{color:var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover .tooltip,.example-wrap.should_panic:hover .tooltip{color:var(--codeblock-error-hover-color);}.example-wrap.ignore:hover .tooltip{color:var(--codeblock-ignore-hover-color);}.example-wrap .tooltip{position:absolute;display:block;left:-25px;top:5px;margin:0;line-height:1;}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip,.example-wrap.ignore .tooltip{font-weight:bold;font-size:1.25rem;}.content .docblock .warning{border-left:2px solid var(--warning-border-color);padding:14px;position:relative;overflow-x:visible !important;}.content .docblock .warning::before{color:var(--warning-border-color);content:"ⓘ";position:absolute;left:-25px;top:5px;font-weight:bold;font-size:1.25rem;}a.test-arrow{visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;color:var(--test-arrow-color);background-color:var(--test-arrow-background-color);}a.test-arrow:hover{color:var(--test-arrow-hover-color);background-color:var(--test-arrow-hover-background-color);}.example-wrap:hover .test-arrow{visibility:visible;}.code-attribute{font-weight:300;color:var(--code-attribute-color);}.item-spacer{width:100%;height:12px;display:block;}.out-of-band>span.since{font-size:1.25rem;}.sub-variant h4{font-size:1rem;font-weight:400;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}:target{padding-right:3px;background-color:var(--target-background-color);border-right:3px solid var(--target-border-color);}.code-header a.tooltip{color:inherit;margin-right:15px;position:relative;}.code-header a.tooltip:hover{color:var(--link-color);}a.tooltip:hover::after{position:absolute;top:calc(100% - 10px);left:-15px;right:-15px;height:20px;content:"\00a0";}.fade-out{opacity:0;transition:opacity 0.45s cubic-bezier(0,0,0.1,1.0);}.popover.tooltip .content{margin:0.25em 0.5em;}.popover.tooltip .content pre,.popover.tooltip .content code{background:transparent;margin:0;padding:0;font-size:1.25rem;white-space:pre-wrap;}.popover.tooltip .content>h3:first-child{margin:0 0 5px 0;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#search-tabs{display:flex;flex-direction:row;gap:1px;margin-bottom:4px;}#search-tabs button{text-align:center;font-size:1.125rem;border:0;border-top:2px solid;flex:1;line-height:1.5;color:inherit;}#search-tabs button:not(.selected){background-color:var(--search-tab-button-not-selected-background);border-top-color:var(--search-tab-button-not-selected-border-top-color);}#search-tabs button:hover,#search-tabs button.selected{background-color:var(--search-tab-button-selected-background);border-top-color:var(--search-tab-button-selected-border-top-color);}#search-tabs .count{font-size:1rem;font-variant-numeric:tabular-nums;color:var(--search-tab-title-count-color);}#search .error code{border-radius:3px;background-color:var(--search-error-code-background-color);}.search-corrections{font-weight:normal;}#src-sidebar-toggle{position:sticky;top:0;left:0;font-size:1.25rem;border-bottom:1px solid;display:flex;height:40px;justify-content:stretch;align-items:stretch;z-index:10;}#src-sidebar{width:100%;overflow:auto;}#src-sidebar>.title{font-size:1.5rem;text-align:center;border-bottom:1px solid var(--border-color);margin-bottom:6px;}#src-sidebar div.files>a:hover,details.dir-entry summary:hover,#src-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:var(--src-sidebar-background-hover);}#src-sidebar div.files>a.selected{background-color:var(--src-sidebar-background-selected);}#src-sidebar-toggle>button{font-size:inherit;font-weight:bold;background:none;color:inherit;text-align:center;border:none;outline:none;flex:1 1;-webkit-appearance:none;opacity:1;}#settings-menu,#help-button{margin-left:4px;display:flex;}#sidebar-button{display:none;}.hide-sidebar #sidebar-button{display:flex;margin-right:4px;position:fixed;left:6px;height:34px;width:34px;background-color:var(--main-background-color);z-index:1;}#settings-menu>a,#help-button>a,#sidebar-button>a{display:flex;align-items:center;justify-content:center;background-color:var(--button-background-color);border:1px solid var(--border-color);border-radius:2px;color:var(--settings-button-color);font-size:20px;width:33px;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>a:hover,#help-button>a:focus,#sidebar-button>a:hover,#sidebar-button>a:focus{border-color:var(--settings-button-border-focus);}#sidebar-button>a:before{content:url('data:image/svg+xml,\ + \ + \ + ');width:22px;height:22px;}#copy-path{color:var(--copy-path-button-color);background:var(--main-background-color);height:34px;margin-left:10px;padding:0;padding-left:2px;border:0;width:33px;}#copy-path>img{filter:var(--copy-path-img-filter);}#copy-path:hover>img{filter:var(--copy-path-img-hover-filter);}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px var(--border-color);border-radius:3px;color:var(--kbd-color);background-color:var(--kbd-background);box-shadow:inset 0 -1px 0 var(--kbd-box-shadow-color);}ul.all-items>li{list-style:none;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 -4px;padding:0 0 0 4px;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.toggle{contain:layout;position:relative;}details.toggle>summary.hideme{cursor:pointer;font-size:1rem;}details.toggle>summary{list-style:none;outline:none;}details.toggle>summary::-webkit-details-marker,details.toggle>summary::marker{display:none;}details.toggle>summary.hideme>span{margin-left:9px;}details.toggle>summary::before{background:url('data:image/svg+xml,') no-repeat top left;content:"";cursor:pointer;width:16px;height:16px;display:inline-block;vertical-align:middle;opacity:.5;filter:var(--toggle-filter);}details.toggle>summary.hideme>span,.more-examples-toggle summary,.more-examples-toggle .hide-more{color:var(--toggles-color);}details.toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.toggle>summary.hideme::after{content:"";}details.toggle>summary:focus::before,details.toggle>summary:hover::before{opacity:1;}details.toggle>summary:focus-visible::before{outline:1px dotted #000;outline-offset:1px;}details.non-exhaustive{margin-bottom:8px;}details.toggle>summary.hideme::before{position:relative;}details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.toggle[open] >summary.hideme{position:absolute;}details.toggle[open] >summary.hideme>span{display:none;}details.toggle[open] >summary::before{background:url('data:image/svg+xml,') no-repeat top left;}details.toggle[open] >summary::after{content:"Collapse";}.docblock summary>*{display:inline-block;}.docblock>.example-wrap:first-child .tooltip{margin-top:16px;}@media (max-width:850px){#search-tabs .count{display:block;}}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.hide-sidebar #sidebar-button{position:static;}.rustdoc{display:block;}main{padding-left:15px;padding-top:0px;}.main-heading{flex-direction:column;}.out-of-band{text-align:left;margin-left:initial;padding:initial;}.out-of-band .since::before{content:"Since ";}.sidebar .logo-container,.sidebar .location,.sidebar-resizer{display:none;}.sidebar{position:fixed;top:45px;left:-1000px;z-index:11;height:calc(100vh - 45px);width:200px;}.src main,.rustdoc.src .sidebar{top:0;padding:0;height:100vh;border:0;}.sidebar.shown,.src-sidebar-expanded .src .sidebar,.rustdoc:not(.src) .sidebar:focus-within{left:0;}.mobile-topbar h2{padding-bottom:0;margin:auto 0.5em auto auto;overflow:hidden;font-size:24px;}.mobile-topbar h2 a{display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin:5px 0 5px 20px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.hide-sidebar .mobile-topbar{display:none;}.sidebar-menu-toggle{width:45px;font-size:32px;border:none;color:var(--main-color);}.hide-sidebar .sidebar-menu-toggle{display:none;}.sidebar-elems{margin-top:1em;}.anchor{display:none !important;}#main-content>details.toggle>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}#src-sidebar-toggle{position:fixed;left:1px;top:100px;width:30px;font-size:1.5rem;padding:0;z-index:10;border-top-right-radius:3px;border-bottom-right-radius:3px;border:1px solid;border-left:0;}.src-sidebar-expanded #src-sidebar-toggle{left:unset;top:unset;width:unset;border-top-right-radius:unset;border-bottom-right-radius:unset;position:sticky;border:0;border-bottom:1px solid;}#copy-path,#help-button{display:none;}#sidebar-button>a:before{content:url('data:image/svg+xml,\ + \ + \ + ');width:22px;height:22px;}.item-table,.item-row,.item-table>li,.item-table>li>div,.search-results>a,.search-results>a>div{display:block;}.search-results>a{padding:5px 0px;}.search-results>a>div.desc,.item-table>li>div.desc{padding-left:2em;}.search-results .result-name{display:block;}.search-results .result-name .typename{width:initial;margin-right:0;}.search-results .result-name .typename,.search-results .result-name .path{display:inline;}.src-sidebar-expanded .src .sidebar{max-width:100vw;width:100vw;}details.toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.toggle>summary:not(.hideme)::before,#main-content>details.toggle:not(.top-doc)>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}.impl-items>.item-info{margin-left:34px;}.src nav.sub{margin:0;padding:var(--nav-sub-mobile-padding);}}@media (min-width:701px){.scraped-example-title{position:absolute;z-index:10;background:var(--main-background-color);bottom:8px;right:5px;padding:2px 4px;box-shadow:0 0 4px var(--main-background-color);}}@media print{nav.sidebar,nav.sub,.out-of-band,a.src,#copy-path,details.toggle[open] >summary::before,details.toggle>summary::before,details.toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}nav.sub{flex-direction:column;}.search-form{align-self:stretch;}.sub-logo-container>img{height:35px;width:35px;margin-bottom:var(--nav-sub-mobile-padding);}}.variant,.implementors-toggle>summary,.impl,#implementors-list>.docblock,.impl-items>section,.impl-items>.toggle>summary,.methods>section,.methods>.toggle>summary{margin-bottom:0.75em;}.variants>.docblock,.implementors-toggle>.docblock,.impl-items>.toggle[open]:not(:last-child),.methods>.toggle[open]:not(:last-child),.implementors-toggle[open]:not(:last-child){margin-bottom:2em;}#trait-implementations-list .impl-items>.toggle:not(:last-child),#synthetic-implementations-list .impl-items>.toggle:not(:last-child),#blanket-implementations-list .impl-items>.toggle:not(:last-child){margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;border:1px solid var(--scrape-example-help-border-color);border-radius:50px;color:var(--scrape-example-help-color);}.scraped-example-list .scrape-help:hover{border-color:var(--scrape-example-help-hover-border-color);color:var(--scrape-example-help-hover-color);}.scraped-example{position:relative;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:calc(1.5em * 5 + 10px);}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;padding-bottom:0;max-height:calc(1.5em * 5 + 10px);}.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper,.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper pre{max-height:calc(1.5em * 10 + 10px);}.scraped-example .code-wrapper .next,.scraped-example .code-wrapper .prev,.scraped-example .code-wrapper .expand{color:var(--main-color);position:absolute;top:0.25em;z-index:1;padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.scraped-example .code-wrapper .prev{right:2.25em;}.scraped-example .code-wrapper .next{right:1.25em;}.scraped-example .code-wrapper .expand{right:0.25em;}.scraped-example:not(.expanded) .code-wrapper::before,.scraped-example:not(.expanded) .code-wrapper::after{content:" ";width:100%;height:5px;position:absolute;z-index:1;}.scraped-example:not(.expanded) .code-wrapper::before{top:0;background:linear-gradient(to bottom,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example:not(.expanded) .code-wrapper::after{bottom:0;background:linear-gradient(to top,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example .code-wrapper .example-wrap{width:100%;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .example-wrap .rust span.highlight{background:var(--scrape-example-code-line-highlight);}.scraped-example .example-wrap .rust span.highlight.focus{background:var(--scrape-example-code-line-highlight-focus);}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;cursor:pointer;}.more-scraped-examples{margin-left:25px;position:relative;}.toggle-line{position:absolute;top:5px;bottom:0;right:calc(100% + 10px);padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;background:var(--scrape-example-toggle-line-background);}.toggle-line:hover .toggle-line-inner{background:var(--scrape-example-toggle-line-hover-background);}.more-scraped-examples .scraped-example,.example-links{margin-top:20px;}.more-scraped-examples .scraped-example:first-child{margin-top:5px;}.example-links ul{margin-bottom:0;}:root[data-theme="light"]{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);--sidebar-resizer-hover:hsl(207,90%,66%);--sidebar-resizer-active:hsl(207,90%,54%);}:root[data-theme="dark"]{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);--sidebar-resizer-hover:hsl(207,30%,54%);--sidebar-resizer-active:hsl(207,90%,54%);}:root[data-theme="ayu"]{--main-background-color:#0f1419;--main-color:#c5c5c5;--settings-input-color:#ffb454;--settings-input-border-color:#999;--settings-button-color:#fff;--settings-button-border-focus:#e0e0e0;--sidebar-background-color:#14191f;--sidebar-background-color-hover:rgba(70,70,70,0.33);--code-block-background-color:#191f26;--scrollbar-track-background-color:transparent;--scrollbar-thumb-background-color:#5c6773;--scrollbar-color:#5c6773 #24292f;--headings-border-bottom-color:#5c6773;--border-color:#5c6773;--button-background-color:#141920;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#5c6773;--copy-path-button-color:#fff;--copy-path-img-filter:invert(70%);--copy-path-img-hover-filter:invert(100%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ffa0a5;--trait-link-color:#39afd7;--assoc-item-link-color:#39afd7;--function-link-color:#fdd687;--macro-link-color:#a37acc;--keyword-link-color:#39afd7;--mod-link-color:#39afd7;--link-color:#39afd7;--sidebar-link-color:#53b1db;--sidebar-current-link-background-color:transparent;--search-result-link-focus-background-color:#3c3c3c;--search-result-border-color:#aaa3;--search-color:#fff;--search-error-code-background-color:#4f4c4c;--search-results-alias-color:#c5c5c5;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:none;--search-tab-button-not-selected-background:transparent !important;--search-tab-button-selected-border-top-color:none;--search-tab-button-selected-background:#141920 !important;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ff7733;--code-highlight-kw-2-color:#ff7733;--code-highlight-lifetime-color:#ff7733;--code-highlight-prelude-color:#69f2df;--code-highlight-prelude-val-color:#ff7733;--code-highlight-number-color:#b8cc52;--code-highlight-string-color:#b8cc52;--code-highlight-literal-color:#ff7733;--code-highlight-attribute-color:#e6e1cf;--code-highlight-self-color:#36a3d9;--code-highlight-macro-color:#a37acc;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#788797;--code-highlight-doc-comment-color:#a1ac88;--src-line-numbers-span-color:#5c6773;--src-line-number-highlighted-background-color:rgba(255,236,164,0.06);--test-arrow-color:#788797;--test-arrow-background-color:rgba(57,175,215,0.09);--test-arrow-hover-color:#c5c5c5;--test-arrow-hover-background-color:rgba(57,175,215,0.368);--target-background-color:rgba(255,236,164,0.06);--target-border-color:rgba(255,180,76,0.85);--kbd-color:#c5c5c5;--kbd-background:#314559;--kbd-box-shadow-color:#5c6773;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(41%) sepia(12%) saturate(487%) hue-rotate(171deg) brightness(94%) contrast(94%);--crate-search-div-hover-filter:invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg) brightness(113%) contrast(76%);--crate-search-hover-border:#e0e0e0;--src-sidebar-background-selected:#14191f;--src-sidebar-background-hover:#14191f;--table-alt-row-background-color:#191f26;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(15,20,25,1);--scrape-example-code-wrapper-background-end:rgba(15,20,25,0);--sidebar-resizer-hover:hsl(34,50%,33%);--sidebar-resizer-active:hsl(34,100%,66%);}:root[data-theme="ayu"] h1,:root[data-theme="ayu"] h2,:root[data-theme="ayu"] h3,:root[data-theme="ayu"] h4,:where(:root[data-theme="ayu"]) h1 a,:root[data-theme="ayu"] .sidebar h2 a,:root[data-theme="ayu"] .sidebar h3 a,:root[data-theme="ayu"] #source-sidebar>.title{color:#fff;}:root[data-theme="ayu"] .docblock code{color:#ffb454;}:root[data-theme="ayu"] .docblock a>code{color:#39AFD7 !important;}:root[data-theme="ayu"] .code-header,:root[data-theme="ayu"] .docblock pre>code,:root[data-theme="ayu"] pre,:root[data-theme="ayu"] pre>code,:root[data-theme="ayu"] .item-info code,:root[data-theme="ayu"] .rustdoc.source .example-wrap{color:#e6e1cf;}:root[data-theme="ayu"] .sidebar .current,:root[data-theme="ayu"] .sidebar .current a,:root[data-theme="ayu"] .sidebar a:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:hover,:root[data-theme="ayu"] details.dir-entry summary:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:focus,:root[data-theme="ayu"] details.dir-entry summary:focus,:root[data-theme="ayu"] #src-sidebar div.files>a.selected{color:#ffb44c;}:root[data-theme="ayu"] .sidebar-elems .location{color:#ff7733;}:root[data-theme="ayu"] .src-line-numbers .line-highlighted{color:#708090;padding-right:7px;border-right:1px solid #ffb44c;}:root[data-theme="ayu"] .search-results a:hover,:root[data-theme="ayu"] .search-results a:focus{color:#fff !important;background-color:#3c3c3c;}:root[data-theme="ayu"] .search-results a{color:#0096cf;}:root[data-theme="ayu"] .search-results a div.desc{color:#c5c5c5;}:root[data-theme="ayu"] .result-name .primitive>i,:root[data-theme="ayu"] .result-name .keyword>i{color:#788797;}:root[data-theme="ayu"] #search-tabs>button.selected{border-bottom:1px solid #ffb44c !important;border-top:none;}:root[data-theme="ayu"] #search-tabs>button:not(.selected){border:none;background-color:transparent !important;}:root[data-theme="ayu"] #search-tabs>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}:root[data-theme="ayu"] #settings-menu>a img,:root[data-theme="ayu"] #sidebar-button>a:before{filter:invert(100);} \ No newline at end of file diff --git a/static.files/scrape-examples-ef1e698c1d417c0c.js b/static.files/scrape-examples-ef1e698c1d417c0c.js new file mode 100644 index 000000000..ba830e374 --- /dev/null +++ b/static.files/scrape-examples-ef1e698c1d417c0c.js @@ -0,0 +1 @@ +"use strict";(function(){const DEFAULT_MAX_LINES=5;const HIDDEN_MAX_LINES=10;function scrollToLoc(elt,loc,isHidden){const lines=elt.querySelector(".src-line-numbers");let scrollOffset;const maxLines=isHidden?HIDDEN_MAX_LINES:DEFAULT_MAX_LINES;if(loc[1]-loc[0]>maxLines){const line=Math.max(0,loc[0]-1);scrollOffset=lines.children[line].offsetTop}else{const wrapper=elt.querySelector(".code-wrapper");const halfHeight=wrapper.offsetHeight/2;const offsetTop=lines.children[loc[0]].offsetTop;const lastLine=lines.children[loc[1]];const offsetBot=lastLine.offsetTop+lastLine.offsetHeight;const offsetMid=(offsetTop+offsetBot)/2;scrollOffset=offsetMid-halfHeight}lines.scrollTo(0,scrollOffset);elt.querySelector(".rust").scrollTo(0,scrollOffset)}function updateScrapedExample(example,isHidden){const locs=JSON.parse(example.attributes.getNamedItem("data-locs").textContent);let locIndex=0;const highlights=Array.prototype.slice.call(example.querySelectorAll(".highlight"));const link=example.querySelector(".scraped-example-title a");if(locs.length>1){const onChangeLoc=changeIndex=>{removeClass(highlights[locIndex],"focus");changeIndex();scrollToLoc(example,locs[locIndex][0],isHidden);addClass(highlights[locIndex],"focus");const url=locs[locIndex][1];const title=locs[locIndex][2];link.href=url;link.innerHTML=title};example.querySelector(".prev").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex-1+locs.length)%locs.length})});example.querySelector(".next").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex+1)%locs.length})})}const expandButton=example.querySelector(".expand");if(expandButton){expandButton.addEventListener("click",()=>{if(hasClass(example,"expanded")){removeClass(example,"expanded");scrollToLoc(example,locs[0][0],isHidden)}else{addClass(example,"expanded")}})}scrollToLoc(example,locs[0][0],isHidden)}const firstExamples=document.querySelectorAll(".scraped-example-list > .scraped-example");onEachLazy(firstExamples,el=>updateScrapedExample(el,false));onEachLazy(document.querySelectorAll(".more-examples-toggle"),toggle=>{onEachLazy(toggle.querySelectorAll(".toggle-line, .hide-more"),button=>{button.addEventListener("click",()=>{toggle.open=false})});const moreExamples=toggle.querySelectorAll(".scraped-example");toggle.querySelector("summary").addEventListener("click",()=>{setTimeout(()=>{onEachLazy(moreExamples,el=>updateScrapedExample(el,true))})},{once:true})})})() \ No newline at end of file diff --git a/static.files/search-2b6ce74ff89ae146.js b/static.files/search-2b6ce74ff89ae146.js new file mode 100644 index 000000000..054597030 --- /dev/null +++ b/static.files/search-2b6ce74ff89ae146.js @@ -0,0 +1,5 @@ +"use strict";if(!Array.prototype.toSpliced){Array.prototype.toSpliced=function(){const me=this.slice();Array.prototype.splice.apply(me,arguments);return me}}(function(){const itemTypes=["keyword","primitive","mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","associatedtype","constant","associatedconstant","union","foreigntype","existential","attr","derive","traitalias","generic",];const longItemTypes=["keyword","primitive type","module","extern crate","re-export","struct","enum","function","type alias","static","trait","","trait method","method","struct field","enum variant","macro","assoc type","constant","assoc const","union","foreign type","existential type","attribute macro","derive macro","trait alias",];const TY_GENERIC=itemTypes.indexOf("generic");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("search-tabs").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});const isTypeSearch=(nb>0||iter===1);iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb;const correctionsElem=document.getElementsByClassName("search-corrections");if(isTypeSearch){removeClass(correctionsElem[0],"hidden")}else{addClass(correctionsElem[0],"hidden")}}else if(nb!==0){printTab(0)}}const editDistanceState={current:[],prev:[],prevPrev:[],calculate:function calculate(a,b,limit){if(a.lengthlimit){return limit+1}while(b.length>0&&b[0]===a[0]){a=a.substring(1);b=b.substring(1)}while(b.length>0&&b[b.length-1]===a[a.length-1]){a=a.substring(0,a.length-1);b=b.substring(0,b.length-1)}if(b.length===0){return minDist}const aLength=a.length;const bLength=b.length;for(let i=0;i<=bLength;++i){this.current[i]=0;this.prev[i]=i;this.prevPrev[i]=Number.MAX_VALUE}for(let i=1;i<=aLength;++i){this.current[0]=i;const aIdx=i-1;for(let j=1;j<=bLength;++j){const bIdx=j-1;const substitutionCost=a[aIdx]===b[bIdx]?0:1;this.current[j]=Math.min(this.prev[j]+1,this.current[j-1]+1,this.prev[j-1]+substitutionCost);if((i>1)&&(j>1)&&(a[aIdx]===b[bIdx-1])&&(a[aIdx-1]===b[bIdx])){this.current[j]=Math.min(this.current[j],this.prevPrev[j-2]+1)}}const prevPrevTmp=this.prevPrev;this.prevPrev=this.prev;this.prev=this.current;this.current=prevPrevTmp}const distance=this.prev[bLength];return distance<=limit?distance:(limit+1)},};function editDistance(a,b,limit){return editDistanceState.calculate(a,b,limit)}function initSearch(rawSearchIndex){const MAX_RESULTS=200;const NO_TYPE_FILTER=-1;let searchIndex;let functionTypeFingerprint;let currentResults;let typeNameIdMap;const ALIASES=new Map();let typeNameIdOfArray;let typeNameIdOfSlice;let typeNameIdOfArrayOrSlice;function buildTypeMapIndex(name,isAssocType){if(name===""||name===null){return null}if(typeNameIdMap.has(name)){const obj=typeNameIdMap.get(name);obj.assocOnly=isAssocType&&obj.assocOnly;return obj.id}else{const id=typeNameIdMap.size;typeNameIdMap.set(name,{id,assocOnly:isAssocType});return id}}function isSpecialStartCharacter(c){return"<\"".indexOf(c)!==-1}function isEndCharacter(c){return"=,>-]".indexOf(c)!==-1}function isErrorCharacter(c){return"()".indexOf(c)!==-1}function itemTypeFromName(typename){const index=itemTypes.findIndex(i=>i===typename);if(index<0){throw["Unknown type filter ",typename]}return index}function getStringElem(query,parserState,isInGenerics){if(isInGenerics){throw["Unexpected ","\""," in generics"]}else if(query.literalSearch){throw["Cannot have more than one literal search element"]}else if(parserState.totalElems-parserState.genericsElems>0){throw["Cannot use literal search when there is more than one element"]}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw["Unclosed ","\""]}else if(parserState.userQuery[end]!=="\""){throw["Unexpected ",parserState.userQuery[end]," in a string element"]}else if(start===end){throw["Cannot have empty string element"]}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function isIdentCharacter(c){return(c==="_"||(c>="0"&&c<="9")||(c>="a"&&c<="z")||(c>="A"&&c<="Z"))}function isSeparatorCharacter(c){return c===","||c==="="}function isPathSeparator(c){return c===":"||c===" "}function prevIs(parserState,lookingFor){let pos=parserState.pos;while(pos>0){const c=parserState.userQuery[pos-1];if(c===lookingFor){return true}else if(c!==" "){break}pos-=1}return false}function isLastElemGeneric(elems,parserState){return(elems.length>0&&elems[elems.length-1].generics.length>0)||prevIs(parserState,">")}function skipWhitespace(parserState){while(parserState.pos0){throw["Cannot have more than one element if you use quotes"]}const typeFilter=parserState.typeFilter;parserState.typeFilter=null;if(name==="!"){if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive never type ","!"," and ",typeFilter," both specified",]}if(generics.length!==0){throw["Never type ","!"," does not accept generic parameters",]}const bindingName=parserState.isInBinding;parserState.isInBinding=null;return{name:"never",id:null,fullPath:["never"],pathWithoutLast:[],pathLast:"never",normalizedPathLast:"never",generics:[],bindings:new Map(),typeFilter:"primitive",bindingName,}}const quadcolon=/::\s*::/.exec(path);if(path.startsWith("::")){throw["Paths cannot start with ","::"]}else if(path.endsWith("::")){throw["Paths cannot end with ","::"]}else if(quadcolon!==null){throw["Unexpected ",quadcolon[0]]}const pathSegments=path.split(/(?:::\s*)|(?:\s+(?:::\s*)?)/);if(pathSegments.length===0||(pathSegments.length===1&&pathSegments[0]==="")){if(generics.length>0||prevIs(parserState,">")){throw["Found generics without a path"]}else{throw["Unexpected ",parserState.userQuery[parserState.pos]]}}for(const[i,pathSegment]of pathSegments.entries()){if(pathSegment==="!"){if(i!==0){throw["Never type ","!"," is not associated item"]}pathSegments[i]="never"}}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}const bindingName=parserState.isInBinding;parserState.isInBinding=null;const bindings=new Map();const pathLast=pathSegments[pathSegments.length-1];return{name:name.trim(),id:null,fullPath:pathSegments,pathWithoutLast:pathSegments.slice(0,pathSegments.length-1),pathLast,normalizedPathLast:pathLast.replace(/_/g,""),generics:generics.filter(gen=>{if(gen.bindingName!==null){bindings.set(gen.bindingName.name,[gen,...gen.bindingName.generics]);return false}return true}),bindings,typeFilter,bindingName,}}function getIdentEndPosition(parserState){const start=parserState.pos;let end=parserState.pos;let foundExclamation=-1;while(parserState.pos=end){throw["Found generics without a path"]}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}if(isStringElem){skipWhitespace(parserState)}if(start>=end&&generics.length===0){return}if(parserState.userQuery[parserState.pos]==="="){if(parserState.isInBinding){throw["Cannot write ","="," twice in a binding"]}if(!isInGenerics){throw["Type parameter ","="," must be within generics list"]}const name=parserState.userQuery.slice(start,end).trim();if(name==="!"){throw["Type parameter ","="," key cannot be ","!"," never type"]}if(name.includes("!")){throw["Type parameter ","="," key cannot be ","!"," macro"]}if(name.includes("::")){throw["Type parameter ","="," key cannot contain ","::"," path"]}if(name.includes(":")){throw["Type parameter ","="," key cannot contain ",":"," type"]}parserState.isInBinding={name,generics}}else{elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics))}}}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;let start=parserState.pos;const oldTypeFilter=parserState.typeFilter;parserState.typeFilter=null;const oldIsInBinding=parserState.isInBinding;parserState.isInBinding=null;let extra="";if(endChar===">"){extra="<"}else if(endChar==="]"){extra="["}else if(endChar===""){extra="->"}else{extra=endChar}while(parserState.pos"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(endChar!==""){throw["Expected ",",",", ","=",", or ",endChar,...extra,", found ",c,]}throw["Expected ",","," or ","=",...extra,", found ",c,]}const posBefore=parserState.pos;start=parserState.pos;getNextElem(query,parserState,elems,endChar!=="");if(endChar!==""&&parserState.pos>=parserState.length){throw["Unclosed ",extra]}if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}if(parserState.pos>=parserState.length&&endChar!==""){throw["Unclosed ",extra]}parserState.pos+=1;parserState.typeFilter=oldTypeFilter;parserState.isInBinding=oldIsInBinding}function checkExtraTypeFilterCharacters(start,parserState){const query=parserState.userQuery.slice(start,parserState.pos).trim();for(const c in query){if(!isIdentCharacter(query[c])){throw["Unexpected ",query[c]," in type filter (before ",":",")",]}}}function parseInput(query,parserState){let foundStopChar=true;let start=parserState.pos;while(parserState.pos"){if(isReturnArrow(parserState)){break}throw["Unexpected ",c," (did you mean ","->","?)"]}throw["Unexpected ",c]}else if(c===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}else if(query.elems.length===0){throw["Expected type filter before ",":"]}else if(query.literalSearch){throw["Cannot use quotes on type filter"]}const typeFilterElem=query.elems.pop();checkExtraTypeFilterCharacters(start,parserState);parserState.typeFilter=typeFilterElem.name;parserState.pos+=1;parserState.totalElems-=1;query.literalSearch=false;foundStopChar=true;continue}else if(c===" "){skipWhitespace(parserState);continue}if(!foundStopChar){let extra="";if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(parserState.typeFilter!==null){throw["Expected ",","," or ","->",...extra,", found ",c,]}throw["Expected ",",",", ",":"," or ","->",...extra,", found ",c,]}const before=query.elems.length;start=parserState.pos;getNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}while(parserState.pos"]}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),elems:[],returned:[],foundElems:0,totalElems:0,literalSearch:false,error:null,correction:null,proposeCorrectionFrom:null,proposeCorrectionTo:null,typeFingerprint:new Uint32Array(4),}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="all crates"&&rawSearchIndex.has(elem.value)){return elem.value}return null}function parseQuery(userQuery){function convertTypeFilterOnElem(elem){if(elem.typeFilter!==null){let typeFilter=elem.typeFilter;if(typeFilter==="const"){typeFilter="constant"}elem.typeFilter=itemTypeFromName(typeFilter)}else{elem.typeFilter=NO_TYPE_FILTER}for(const elem2 of elem.generics){convertTypeFilterOnElem(elem2)}for(const constraints of elem.bindings.values()){for(const constraint of constraints){convertTypeFilterOnElem(constraint)}}}userQuery=userQuery.trim().replace(/\r|\n|\t/g," ");const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,isInBinding:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);for(const elem of query.elems){convertTypeFilterOnElem(elem)}for(const elem of query.returned){convertTypeFilterOnElem(elem)}}catch(err){query=newParsedQuery(userQuery);query.error=err;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;query.totalElems=parserState.totalElems;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}function execQuery(parsedQuery,filterCrates,currentCrate){const results_others=new Map(),results_in_args=new Map(),results_returned=new Map();function transformResults(results){const duplicates=new Set();const out=[];for(const result of results){if(result.id!==-1){const obj=searchIndex[result.id];obj.dist=result.dist;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;if(duplicates.has(obj.fullPath)){continue}duplicates.add(obj.fullPath);obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}function sortResults(results,isType,preferredCrate){if(results.size===0){return[]}const userQuery=parsedQuery.userQuery;const result_list=[];for(const result of results.values()){result.item=searchIndex[result.id];result.word=searchIndex[result.id].word;result_list.push(result)}result_list.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.path_dist;b=bbb.path_dist;if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}a=(aaa.dist);b=(bbb.dist);if(a!==b){return a-b}a=aaa.item.deprecated;b=bbb.item.deprecated;if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});return transformResults(result_list)}function unifyFunctionTypes(fnTypesIn,queryElems,whereClause,mgensIn,solutionCb){const mgens=mgensIn===null?null:new Map(mgensIn);if(queryElems.length===0){return!solutionCb||solutionCb(mgens)}if(!fnTypesIn||fnTypesIn.length===0){return false}const ql=queryElems.length;const fl=fnTypesIn.length;if(ql===1&&queryElems[0].generics.length===0&&queryElems[0].bindings.size===0){const queryElem=queryElems[0];for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,whereClause,mgens)){continue}if(fnType.id<0&&queryElem.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==queryElem.id){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,queryElem.id);if(!solutionCb||solutionCb(mgensScratch)){return true}}else if(!solutionCb||solutionCb(mgens?new Map(mgens):null)){return true}}for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens)){continue}if(fnType.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,0);if(unifyFunctionTypes(whereClause[(-fnType.id)-1],queryElems,whereClause,mgensScratch,solutionCb)){return true}}else if(unifyFunctionTypes([...fnType.generics,...Array.from(fnType.bindings.values()).flat()],queryElems,whereClause,mgens?new Map(mgens):null,solutionCb)){return true}}return false}const fnTypes=fnTypesIn.slice();const flast=fl-1;const qlast=ql-1;const queryElem=queryElems[qlast];let queryElemsTmp=null;for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,whereClause,mgens)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==queryElem.id){continue}mgensScratch.set(fnType.id,queryElem.id)}else{mgensScratch=mgens}fnTypes[i]=fnTypes[flast];fnTypes.length=flast;if(!queryElemsTmp){queryElemsTmp=queryElems.slice(0,qlast)}const passesUnification=unifyFunctionTypes(fnTypes,queryElemsTmp,whereClause,mgensScratch,mgensScratch=>{if(fnType.generics.length===0&&queryElem.generics.length===0&&fnType.bindings.size===0&&queryElem.bindings.size===0){return!solutionCb||solutionCb(mgensScratch)}const solution=unifyFunctionTypeCheckBindings(fnType,queryElem,whereClause,mgensScratch);if(!solution){return false}const simplifiedGenerics=solution.simplifiedGenerics;for(const simplifiedMgens of solution.mgens){const passesUnification=unifyFunctionTypes(simplifiedGenerics,queryElem.generics,whereClause,simplifiedMgens,solutionCb);if(passesUnification){return true}}return false});if(passesUnification){return true}fnTypes[flast]=fnTypes[i];fnTypes[i]=fnType;fnTypes.length=fl}for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==0){continue}mgensScratch.set(fnType.id,0)}else{mgensScratch=mgens}const generics=fnType.id<0?whereClause[(-fnType.id)-1]:fnType.generics;const bindings=fnType.bindings?Array.from(fnType.bindings.values()).flat():[];const passesUnification=unifyFunctionTypes(fnTypes.toSpliced(i,1,...generics,...bindings),queryElems,whereClause,mgensScratch,solutionCb);if(passesUnification){return true}}return false}function unifyFunctionTypeIsMatchCandidate(fnType,queryElem,whereClause,mgensIn){if(!typePassesFilter(queryElem.typeFilter,fnType.ty)){return false}if(fnType.id<0&&queryElem.id<0){if(mgensIn){if(mgensIn.has(fnType.id)&&mgensIn.get(fnType.id)!==queryElem.id){return false}for(const[fid,qid]of mgensIn.entries()){if(fnType.id!==fid&&queryElem.id===qid){return false}if(fnType.id===fid&&queryElem.id!==qid){return false}}}return true}else{if(queryElem.id===typeNameIdOfArrayOrSlice&&(fnType.id===typeNameIdOfSlice||fnType.id===typeNameIdOfArray)){}else if(fnType.id!==queryElem.id||queryElem.id===null){return false}if((fnType.generics.length+fnType.bindings.size)===0&&queryElem.generics.length!==0){return false}if(fnType.bindings.size0){const fnTypePath=fnType.path!==undefined&&fnType.path!==null?fnType.path.split("::"):[];if(queryElemPathLength>fnTypePath.length){return false}let i=0;for(const path of fnTypePath){if(path===queryElem.pathWithoutLast[i]){i+=1;if(i>=queryElemPathLength){break}}}if(i0){let mgensSolutionSet=[mgensIn];for(const[name,constraints]of queryElem.bindings.entries()){if(mgensSolutionSet.length===0){return false}if(!fnType.bindings.has(name)){return false}const fnTypeBindings=fnType.bindings.get(name);mgensSolutionSet=mgensSolutionSet.flatMap(mgens=>{const newSolutions=[];unifyFunctionTypes(fnTypeBindings,constraints,whereClause,mgens,newMgens=>{newSolutions.push(newMgens);return false});return newSolutions})}if(mgensSolutionSet.length===0){return false}const binds=Array.from(fnType.bindings.entries()).flatMap(entry=>{const[name,constraints]=entry;if(queryElem.bindings.has(name)){return[]}else{return constraints}});if(simplifiedGenerics.length>0){simplifiedGenerics=[...simplifiedGenerics,...binds]}else{simplifiedGenerics=binds}return{simplifiedGenerics,mgens:mgensSolutionSet}}return{simplifiedGenerics,mgens:[mgensIn]}}function unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens){if(fnType.id<0&&queryElem.id>=0){if(!whereClause){return false}if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){return false}const mgensTmp=new Map(mgens);mgensTmp.set(fnType.id,null);return checkIfInList(whereClause[(-fnType.id)-1],queryElem,whereClause,mgensTmp)}else if(fnType.generics.length>0||fnType.bindings.size>0){const simplifiedGenerics=[...fnType.generics,...Array.from(fnType.bindings.values()).flat(),];return checkIfInList(simplifiedGenerics,queryElem,whereClause,mgens)}return false}function checkIfInList(list,elem,whereClause,mgens){for(const entry of list){if(checkType(entry,elem,whereClause,mgens)){return true}}return false}function checkType(row,elem,whereClause,mgens){if(row.bindings.size===0&&elem.bindings.size===0){if(elem.id<0){return row.id<0||checkIfInList(row.generics,elem,whereClause,mgens)}if(row.id>0&&elem.id>0&&elem.pathWithoutLast.length===0&&typePassesFilter(elem.typeFilter,row.ty)&&elem.generics.length===0&&elem.id!==typeNameIdOfArrayOrSlice){return row.id===elem.id||checkIfInList(row.generics,elem,whereClause,mgens)}}return unifyFunctionTypes([row],[elem],whereClause,mgens)}function checkPath(contains,ty,maxEditDistance){if(contains.length===0){return 0}let ret_dist=maxEditDistance+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;pathiter:for(let i=length-clength;i>=0;i-=1){let dist_total=0;for(let x=0;xmaxEditDistance){continue pathiter}dist_total+=dist}ret_dist=Math.min(ret_dist,Math.round(dist_total/clength))}return ret_dist}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,deprecated:item.deprecated,implDisambiguator:item.implDisambiguator,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES.has(filterCrates)&&ALIASES.get(filterCrates).has(lowerQuery)){const query_aliases=ALIASES.get(filterCrates).get(lowerQuery);for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{for(const[crate,crateAliasesIndex]of ALIASES){if(crateAliasesIndex.has(lowerQuery)){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=crateAliasesIndex.get(lowerQuery);for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}}}const sortFunc=(aaa,bbb)=>{if(aaa.path{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach(pushFunc);crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,dist,path_dist,maxEditDistance){if(dist<=maxEditDistance||index!==-1){if(results.has(fullId)){const result=results.get(fullId);if(result.dontValidate||result.dist<=dist){return}}results.set(fullId,{id:id,index:index,dontValidate:parsedQuery.literalSearch,dist:dist,path_dist:path_dist,})}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned,maxEditDistance){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let path_dist=0;const fullId=row.id;const tfpDist=compareTypeFingerprints(fullId,parsedQuery.typeFingerprint);if(tfpDist!==null){const in_args=row.type&&row.type.inputs&&checkIfInList(row.type.inputs,elem,row.type.where_clause);const returned=row.type&&row.type.output&&checkIfInList(row.type.output,elem,row.type.where_clause);if(in_args){results_in_args.max_dist=Math.max(results_in_args.max_dist||0,tfpDist);const maxDist=results_in_args.sizenormalizedIndex&&normalizedIndex!==-1)){index=normalizedIndex}if(elem.fullPath.length>1){path_dist=checkPath(elem.pathWithoutLast,row,maxEditDistance);if(path_dist>maxEditDistance){return}}if(parsedQuery.literalSearch){if(row.word===elem.pathLast){addIntoResults(results_others,fullId,pos,index,0,path_dist)}return}const dist=editDistance(row.normalizedName,elem.normalizedPathLast,maxEditDistance);if(index===-1&&dist+path_dist>maxEditDistance){return}addIntoResults(results_others,fullId,pos,index,dist,path_dist,maxEditDistance)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)||!row.type){return}const tfpDist=compareTypeFingerprints(row.id,parsedQuery.typeFingerprint);if(tfpDist===null){return}if(results.size>=MAX_RESULTS&&tfpDist>results.max_dist){return}if(!unifyFunctionTypes(row.type.inputs,parsedQuery.elems,row.type.where_clause,null,mgens=>{return unifyFunctionTypes(row.type.output,parsedQuery.returned,row.type.where_clause,mgens)})){return}results.max_dist=Math.max(results.max_dist||0,tfpDist);addIntoResults(results,row.id,pos,0,tfpDist,0,Number.MAX_VALUE)}function innerRunQuery(){let queryLen=0;for(const elem of parsedQuery.elems){queryLen+=elem.name.length}for(const elem of parsedQuery.returned){queryLen+=elem.name.length}const maxEditDistance=Math.floor(queryLen/3);const genericSymbols=new Map();function convertNameToId(elem,isAssocType){if(typeNameIdMap.has(elem.normalizedPathLast)&&(isAssocType||!typeNameIdMap.get(elem.normalizedPathLast).assocOnly)){elem.id=typeNameIdMap.get(elem.normalizedPathLast).id}else if(!parsedQuery.literalSearch){let match=null;let matchDist=maxEditDistance+1;let matchName="";for(const[name,{id,assocOnly}]of typeNameIdMap){const dist=editDistance(name,elem.normalizedPathLast,maxEditDistance);if(dist<=matchDist&&dist<=maxEditDistance&&(isAssocType||!assocOnly)){if(dist===matchDist&&matchName>name){continue}match=id;matchDist=dist;matchName=name}}if(match!==null){parsedQuery.correction=matchName}elem.id=match}if((elem.id===null&&parsedQuery.totalElems>1&&elem.typeFilter===-1&&elem.generics.length===0&&elem.bindings.size===0)||elem.typeFilter===TY_GENERIC){if(genericSymbols.has(elem.name)){elem.id=genericSymbols.get(elem.name)}else{elem.id=-(genericSymbols.size+1);genericSymbols.set(elem.name,elem.id)}if(elem.typeFilter===-1&&elem.name.length>=3){const maxPartDistance=Math.floor(elem.name.length/3);let matchDist=maxPartDistance+1;let matchName="";for(const name of typeNameIdMap.keys()){const dist=editDistance(name,elem.name,maxPartDistance);if(dist<=matchDist&&dist<=maxPartDistance){if(dist===matchDist&&matchName>name){continue}matchDist=dist;matchName=name}}if(matchName!==""){parsedQuery.proposeCorrectionFrom=elem.name;parsedQuery.proposeCorrectionTo=matchName}}elem.typeFilter=TY_GENERIC}if(elem.generics.length>0&&elem.typeFilter===TY_GENERIC){parsedQuery.error=["Generic type parameter ",elem.name," does not accept generic parameters",]}for(const elem2 of elem.generics){convertNameToId(elem2)}elem.bindings=new Map(Array.from(elem.bindings.entries()).map(entry=>{const[name,constraints]=entry;if(!typeNameIdMap.has(name)){parsedQuery.error=["Type parameter ",name," does not exist",];return[null,[]]}for(const elem2 of constraints){convertNameToId(elem2)}return[typeNameIdMap.get(name).id,constraints]}))}const fps=new Set();for(const elem of parsedQuery.elems){convertNameToId(elem);buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint,fps)}for(const elem of parsedQuery.returned){convertNameToId(elem);buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint,fps)}if(parsedQuery.foundElems===1&&parsedQuery.returned.length===0){if(parsedQuery.elems.length===1){const elem=parsedQuery.elems[0];for(let i=0,nSearchIndex=searchIndex.length;i0){const sortQ=(a,b)=>{const ag=a.generics.length===0&&a.bindings.size===0;const bg=b.generics.length===0&&b.bindings.size===0;if(ag!==bg){return ag-bg}const ai=a.id>0;const bi=b.id>0;return ai-bi};parsedQuery.elems.sort(sortQ);parsedQuery.returned.sort(sortQ);for(let i=0,nSearchIndex=searchIndex.length;i");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){const extraClass=display?" active":"";const output=document.createElement("div");if(array.length>0){output.className="search-results "+extraClass;array.forEach(item=>{const name=item.name;const type=itemTypes[item.ty];const longType=longItemTypes[item.ty];const typeName=longType.length!==0?`${longType}`:"?";const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const resultName=document.createElement("div");resultName.className="result-name";resultName.insertAdjacentHTML("beforeend",`${typeName}`);link.appendChild(resultName);let alias=" ";if(item.is_alias){alias=`
\ +${item.alias} - see \ +
`}resultName.insertAdjacentHTML("beforeend",`
${alias}\ +${item.displayPath}${name}\ +
`);const description=document.createElement("div");description.className="desc";description.insertAdjacentHTML("beforeend",item.desc);link.appendChild(description);output.appendChild(link)})}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,array.length]}function makeTabHeader(tabNb,text,nbElems){const fmtNbElems=nbElems<10?`\u{2007}(${nbElems})\u{2007}\u{2007}`:nbElems<100?`\u{2007}(${nbElems})\u{2007}`:`\u{2007}(${nbElems})`;if(searchState.currentTab===tabNb){return""}return""}function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true")){window.onunload=()=>{};searchState.removeQueryParameters();const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=parseQuery(searchState.input.value)}currentResults=results.query.userQuery;const ret_others=addTab(results.others,results.query,true);const ret_in_args=addTab(results.in_args,results.query,false);const ret_returned=addTab(results.returned,results.query,false);let currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}let crates="";if(rawSearchIndex.size>1){crates=" in 
"}let output=`

Results${crates}

`;if(results.query.error!==null){const error=results.query.error;error.forEach((value,index)=>{value=value.split("<").join("<").split(">").join(">");if(index%2!==0){error[index]=`${value.replaceAll(" ", " ")}`}else{error[index]=value}});output+=`

Query parser error: "${error.join("")}".

`;output+="
"+makeTabHeader(0,"In Names",ret_others[1])+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,ret_others[1])+"
";currentTab=0}if(results.query.correction!==null){const orig=results.query.returned.length>0?results.query.returned[0].name:results.query.elems[0].name;output+="

"+`Type "${orig}" not found. `+"Showing results for closest type name "+`"${results.query.correction}" instead.

`}if(results.query.proposeCorrectionFrom!==null){const orig=results.query.proposeCorrectionFrom;const targ=results.query.proposeCorrectionTo;output+="

"+`Type "${orig}" not found and used as generic parameter. `+`Consider searching for "${targ}" instead.

`}const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("search-tabs").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function updateSearchHistory(url){if(!browserSupportsHistoryApi()){return}const params=searchState.getQueryStringParams();if(!history.state&&!params.search){history.pushState(null,"",url)}else{history.replaceState(null,"",url)}}function search(forced){const query=parseQuery(searchState.input.value.trim());let filterCrates=getFilterCrates();if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}searchState.setLoadingSearch();const params=searchState.getQueryStringParams();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";updateSearchHistory(buildUrl(query.original,filterCrates));showResults(execQuery(query,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildItemSearchTypeAll(types,lowercasePaths){return types.map(type=>buildItemSearchType(type,lowercasePaths))}function buildItemSearchType(type,lowercasePaths,isAssocType){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;const BINDINGS_DATA=2;let pathIndex,generics,bindings;if(typeof type==="number"){pathIndex=type;generics=[];bindings=new Map()}else{pathIndex=type[PATH_INDEX_DATA];generics=buildItemSearchTypeAll(type[GENERICS_DATA],lowercasePaths);if(type.length>BINDINGS_DATA){bindings=new Map(type[BINDINGS_DATA].map(binding=>{const[assocType,constraints]=binding;return[buildItemSearchType(assocType,lowercasePaths,true).id,buildItemSearchTypeAll(constraints,lowercasePaths),]}))}else{bindings=new Map()}}if(pathIndex<0){return{id:pathIndex,ty:TY_GENERIC,path:null,generics,bindings,}}if(pathIndex===0){return{id:null,ty:null,path:null,generics,bindings,}}const item=lowercasePaths[pathIndex-1];return{id:buildTypeMapIndex(item.name,isAssocType),ty:item.ty,path:item.path,generics,bindings,}}function buildFunctionSearchType(functionSearchType,lowercasePaths){const INPUTS_DATA=0;const OUTPUT_DATA=1;if(functionSearchType===0){return null}let inputs,output;if(typeof functionSearchType[INPUTS_DATA]==="number"){inputs=[buildItemSearchType(functionSearchType[INPUTS_DATA],lowercasePaths)]}else{inputs=buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],lowercasePaths)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){output=[buildItemSearchType(functionSearchType[OUTPUT_DATA],lowercasePaths)]}else{output=buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],lowercasePaths)}}else{output=[]}const where_clause=[];const l=functionSearchType.length;for(let i=2;i{k=(~~k+0x7ed55d16)+(k<<12);k=(k ^ 0xc761c23c)^(k>>>19);k=(~~k+0x165667b1)+(k<<5);k=(~~k+0xd3a2646c)^(k<<9);k=(~~k+0xfd7046c5)+(k<<3);return(k ^ 0xb55a4f09)^(k>>>16)};const hashint2=k=>{k=~k+(k<<15);k ^=k>>>12;k+=k<<2;k ^=k>>>4;k=Math.imul(k,2057);return k ^(k>>16)};if(input!==null){const h0a=hashint1(input);const h0b=hashint2(input);const h1a=~~(h0a+Math.imul(h0b,2));const h1b=~~(h0a+Math.imul(h0b,3));const h2a=~~(h0a+Math.imul(h0b,4));const h2b=~~(h0a+Math.imul(h0b,5));output[0]|=(1<<(h0a%32))|(1<<(h1b%32));output[1]|=(1<<(h1a%32))|(1<<(h2b%32));output[2]|=(1<<(h2a%32))|(1<<(h0b%32));fps.add(input)}for(const g of type.generics){buildFunctionTypeFingerprint(g,output,fps)}const fb={id:null,ty:0,generics:[],bindings:new Map(),};for(const[k,v]of type.bindings.entries()){fb.id=k;fb.generics=v;buildFunctionTypeFingerprint(fb,output,fps)}output[3]=fps.size}function compareTypeFingerprints(fullId,queryFingerprint){const fh0=functionTypeFingerprint[fullId*4];const fh1=functionTypeFingerprint[(fullId*4)+1];const fh2=functionTypeFingerprint[(fullId*4)+2];const[qh0,qh1,qh2]=queryFingerprint;const[in0,in1,in2]=[fh0&qh0,fh1&qh1,fh2&qh2];if((in0 ^ qh0)||(in1 ^ qh1)||(in2 ^ qh2)){return null}return functionTypeFingerprint[(fullId*4)+3]}function buildIndex(rawSearchIndex){searchIndex=[];typeNameIdMap=new Map();const charA="A".charCodeAt(0);let currentIndex=0;let id=0;typeNameIdOfArray=buildTypeMapIndex("array");typeNameIdOfSlice=buildTypeMapIndex("slice");typeNameIdOfArrayOrSlice=buildTypeMapIndex("[]");for(const crate of rawSearchIndex.values()){id+=crate.t.length+1}functionTypeFingerprint=new Uint32Array((id+1)*4);id=0;for(const[crate,crateCorpus]of rawSearchIndex){const crateRow={crate:crate,ty:3,name:crate,path:"",desc:crateCorpus.doc,parent:undefined,type:null,id:id,word:crate,normalizedName:crate.indexOf("_")===-1?crate:crate.replace(/_/g,""),deprecated:null,implDisambiguator:null,};id+=1;searchIndex.push(crateRow);currentIndex+=1;const itemTypes=crateCorpus.t;const itemNames=crateCorpus.n;const itemPaths=new Map(crateCorpus.q);const itemDescs=crateCorpus.d;const itemParentIdxs=crateCorpus.i;const itemFunctionSearchTypes=crateCorpus.f;const deprecatedItems=new Set(crateCorpus.c);const implDisambiguator=new Map(crateCorpus.b);const paths=crateCorpus.p;const aliases=crateCorpus.a;const lowercasePaths=[];let len=paths.length;let lastPath=itemPaths.get(0);for(let i=0;i2){path=itemPaths.has(elem[2])?itemPaths.get(elem[2]):lastPath;lastPath=path}lowercasePaths.push({ty:ty,name:name.toLowerCase(),path:path});paths[i]={ty:ty,name:name,path:path}}lastPath="";len=itemTypes.length;for(let i=0;i0?paths[itemParentIdxs[i]-1]:undefined,type,id:id,word,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),deprecated:deprecatedItems.has(i),implDisambiguator:implDisambiguator.has(i)?implDisambiguator.get(i):null,};id+=1;searchIndex.push(row);lastPath=row.path}if(aliases){const currentCrateAliases=new Map();ALIASES.set(crate,currentCrateAliases);for(const alias_name in aliases){if(!Object.prototype.hasOwnProperty.call(aliases,alias_name)){continue}let currentNameAliases;if(currentCrateAliases.has(alias_name)){currentNameAliases=currentCrateAliases.get(alias_name)}else{currentNameAliases=[];currentCrateAliases.set(alias_name,currentNameAliases)}for(const local_alias of aliases[alias_name]){currentNameAliases.push(local_alias+currentIndex)}}}currentIndex+=itemTypes.length}}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;e.preventDefault();search()}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="all crates"){const query=searchState.input.value.trim();updateSearchHistory(buildUrl(query,null))}currentResults=null;search(true)}buildIndex(rawSearchIndex);if(typeof window!=="undefined"){registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}if(typeof exports!=="undefined"){exports.initSearch=initSearch;exports.execQuery=execQuery;exports.parseQuery=parseQuery}}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch(new Map())}})() \ No newline at end of file diff --git a/static.files/settings-4313503d2e1961c2.js b/static.files/settings-4313503d2e1961c2.js new file mode 100644 index 000000000..ab425fe49 --- /dev/null +++ b/static.files/settings-4313503d2e1961c2.js @@ -0,0 +1,17 @@ +"use strict";(function(){const isSettingsPage=window.location.pathname.endsWith("/settings.html");function changeSetting(settingName,value){if(settingName==="theme"){const useSystem=value==="system preference"?"true":"false";updateLocalStorage("use-system-theme",useSystem)}updateLocalStorage(settingName,value);switch(settingName){case"theme":case"preferred-dark-theme":case"preferred-light-theme":updateTheme();updateLightAndDark();break;case"line-numbers":if(value===true){window.rustdoc_add_line_numbers_to_examples()}else{window.rustdoc_remove_line_numbers_from_examples()}break;case"hide-sidebar":if(value===true){addClass(document.documentElement,"hide-sidebar")}else{removeClass(document.documentElement,"hide-sidebar")}break}}function showLightAndDark(){removeClass(document.getElementById("preferred-light-theme"),"hidden");removeClass(document.getElementById("preferred-dark-theme"),"hidden")}function hideLightAndDark(){addClass(document.getElementById("preferred-light-theme"),"hidden");addClass(document.getElementById("preferred-dark-theme"),"hidden")}function updateLightAndDark(){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||(useSystem===null&&getSettingValue("theme")===null)){showLightAndDark()}else{hideLightAndDark()}}function setEvents(settingsElement){updateLightAndDark();onEachLazy(settingsElement.querySelectorAll("input[type=\"checkbox\"]"),toggle=>{const settingId=toggle.id;const settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=()=>{changeSetting(toggle.id,toggle.checked)}});onEachLazy(settingsElement.querySelectorAll("input[type=\"radio\"]"),elem=>{const settingId=elem.name;let settingValue=getSettingValue(settingId);if(settingId==="theme"){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||settingValue===null){settingValue=useSystem==="false"?"light":"system preference"}}if(settingValue!==null&&settingValue!=="null"){elem.checked=settingValue===elem.value}elem.addEventListener("change",ev=>{changeSetting(ev.target.name,ev.target.value)})})}function buildSettingsPageSections(settings){let output="";for(const setting of settings){const js_data_name=setting["js_name"];const setting_name=setting["name"];if(setting["options"]!==undefined){output+=`\ +
+
${setting_name}
+
`;onEach(setting["options"],option=>{const checked=option===setting["default"]?" checked":"";const full=`${js_data_name}-${option.replace(/ /g,"-")}`;output+=`\ + `});output+=`\ +
+
`}else{const checked=setting["default"]===true?" checked":"";output+=`\ +
\ + \ +
`}}return output}function buildSettingsPage(){const theme_names=getVar("themes").split(",").filter(t=>t);theme_names.push("light","dark","ayu");const settings=[{"name":"Theme","js_name":"theme","default":"system preference","options":theme_names.concat("system preference"),},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":theme_names,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":theme_names,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Hide persistent navigation bar","js_name":"hide-sidebar","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
${buildSettingsPageSections(settings)}
`;const el=document.createElement(elementKind);el.id="settings";if(!isSettingsPage){el.className="popover"}el.innerHTML=innerHTML;if(isSettingsPage){document.getElementById(MAIN_ID).appendChild(el)}else{el.setAttribute("tabindex","-1");getSettingsButton().appendChild(el)}return el}const settingsMenu=buildSettingsPage();function displaySettings(){settingsMenu.style.display="";onEachLazy(settingsMenu.querySelectorAll("input[type='checkbox']"),el=>{const val=getSettingValue(el.id);const checked=val==="true";if(checked!==el.checked&&val!==null){el.checked=checked}})}function settingsBlurHandler(event){blurHandler(event,getSettingsButton(),window.hidePopoverMenus)}if(isSettingsPage){getSettingsButton().onclick=event=>{event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");settingsButton.onclick=event=>{if(settingsMenu.contains(event.target)){return}event.preventDefault();const shouldDisplaySettings=settingsMenu.style.display==="none";window.hideAllModals();if(shouldDisplaySettings){displaySettings()}};settingsButton.onblur=settingsBlurHandler;settingsButton.querySelector("a").onblur=settingsBlurHandler;onEachLazy(settingsMenu.querySelectorAll("input"),el=>{el.onblur=settingsBlurHandler});settingsMenu.onblur=settingsBlurHandler}setTimeout(()=>{setEvents(settingsMenu);if(!isSettingsPage){displaySettings()}removeClass(getSettingsButton(),"rotate")},0)})() \ No newline at end of file diff --git a/static.files/src-script-39ed315d46fb705f.js b/static.files/src-script-39ed315d46fb705f.js new file mode 100644 index 000000000..ef74f361e --- /dev/null +++ b/static.files/src-script-39ed315d46fb705f.js @@ -0,0 +1 @@ +"use strict";(function(){const rootPath=getVar("root-path");const NAME_OFFSET=0;const DIRS_OFFSET=1;const FILES_OFFSET=2;const RUSTDOC_MOBILE_BREAKPOINT=700;function closeSidebarIfMobile(){if(window.innerWidth{removeClass(document.documentElement,"src-sidebar-expanded");getToggleLabel().innerText=">";updateLocalStorage("source-sidebar-show","false")};window.rustdocShowSourceSidebar=()=>{addClass(document.documentElement,"src-sidebar-expanded");getToggleLabel().innerText="<";updateLocalStorage("source-sidebar-show","true")};function toggleSidebar(){const child=this.parentNode.children[0];if(child.innerText===">"){window.rustdocShowSourceSidebar()}else{window.rustdocCloseSourceSidebar()}}function createSidebarToggle(){const sidebarToggle=document.createElement("div");sidebarToggle.id="src-sidebar-toggle";const inner=document.createElement("button");if(getCurrentValue("source-sidebar-show")==="true"){inner.innerText="<"}else{inner.innerText=">"}inner.onclick=toggleSidebar;sidebarToggle.appendChild(inner);return sidebarToggle}function createSrcSidebar(){const container=document.querySelector("nav.sidebar");const sidebarToggle=createSidebarToggle();container.insertBefore(sidebarToggle,container.firstChild);const sidebar=document.createElement("div");sidebar.id="src-sidebar";let hasFoundFile=false;const title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);for(const[key,source]of srcIndex){source[NAME_OFFSET]=key;hasFoundFile=createDirEntry(source,sidebar,"",hasFoundFile)}container.appendChild(sidebar);const selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}function highlightSrcLines(){const match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/);if(!match){return}let from=parseInt(match[1],10);let to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to{onEachLazy(e.getElementsByTagName("a"),i_e=>{removeClass(i_e,"line-highlighted")})});for(let i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}const handleSrcHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSrcLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)||ev.ctrlKey||ev.altKey||ev.metaKey){return}ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){const tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",highlightSrcLines);onEachLazy(document.getElementsByClassName("src-line-numbers"),el=>{el.addEventListener("click",handleSrcHighlight)});highlightSrcLines();window.createSrcSidebar=createSrcSidebar})() \ No newline at end of file diff --git a/static.files/storage-f2adc0d6ca4d09fb.js b/static.files/storage-f2adc0d6ca4d09fb.js new file mode 100644 index 000000000..17233608a --- /dev/null +++ b/static.files/storage-f2adc0d6ca4d09fb.js @@ -0,0 +1 @@ +"use strict";const builtinThemes=["light","dark","ayu"];const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");return settingsElement&&settingsElement.dataset?settingsElement.dataset:null})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current===null&&settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return current}const localStoredTheme=getSettingValue("theme");function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(elem&&elem.classList){elem.classList.add(className)}}function removeClass(elem,className){if(elem&&elem.classList){elem.classList.remove(className)}}function onEach(arr,func){for(const elem of arr){if(func(elem)){return true}}return false}function onEachLazy(lazyArray,func){return onEach(Array.prototype.slice.call(lazyArray),func)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}const getVar=(function getVar(name){const el=document.querySelector("head > meta[name='rustdoc-vars']");return el?el.attributes["data-"+name].value:null});function switchTheme(newThemeName,saveTheme){if(saveTheme){updateLocalStorage("theme",newThemeName)}document.documentElement.setAttribute("data-theme",newThemeName);if(builtinThemes.indexOf(newThemeName)!==-1){if(window.currentTheme){window.currentTheme.parentNode.removeChild(window.currentTheme);window.currentTheme=null}}else{const newHref=getVar("root-path")+newThemeName+getVar("resource-suffix")+".css";if(!window.currentTheme){if(document.readyState==="loading"){document.write(``);window.currentTheme=document.getElementById("themeStyle")}else{window.currentTheme=document.createElement("link");window.currentTheme.rel="stylesheet";window.currentTheme.id="themeStyle";window.currentTheme.href=newHref;document.documentElement.appendChild(window.currentTheme)}}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"src-sidebar-expanded")}if(getSettingValue("hide-sidebar")==="true"){addClass(document.documentElement,"hide-sidebar")}function updateSidebarWidth(){const desktopSidebarWidth=getSettingValue("desktop-sidebar-width");if(desktopSidebarWidth&&desktopSidebarWidth!=="null"){document.documentElement.style.setProperty("--desktop-sidebar-width",desktopSidebarWidth+"px")}const srcSidebarWidth=getSettingValue("src-sidebar-width");if(srcSidebarWidth&&srcSidebarWidth!=="null"){document.documentElement.style.setProperty("--src-sidebar-width",srcSidebarWidth+"px")}}updateSidebarWidth();window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0);setTimeout(updateSidebarWidth,0)}}) \ No newline at end of file diff --git a/static.files/wheel-7b819b6101059cd0.svg b/static.files/wheel-7b819b6101059cd0.svg new file mode 100644 index 000000000..83c07f63d --- /dev/null +++ b/static.files/wheel-7b819b6101059cd0.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/trait.impl/core/clone/trait.Clone.js b/trait.impl/core/clone/trait.Clone.js new file mode 100644 index 000000000..348966b91 --- /dev/null +++ b/trait.impl/core/clone/trait.Clone.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl Clone for NetRc"],["impl Clone for SslOpt"],["impl Clone for MultiWaker"],["impl Clone for IpResolve"],["impl Clone for Error"],["impl Clone for MultiError"],["impl<'a> Clone for Protocols<'a>"],["impl Clone for ProxyType"],["impl Clone for SeekResult"],["impl Clone for InfoType"],["impl Clone for HttpVersion"],["impl Clone for ShareError"],["impl Clone for FormError"],["impl Clone for SslVersion"],["impl<'a> Clone for Iter<'a>"],["impl Clone for TimeCondition"],["impl Clone for Auth"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.PartialEq.js b/trait.impl/core/cmp/trait.PartialEq.js new file mode 100644 index 000000000..cbe3abb18 --- /dev/null +++ b/trait.impl/core/cmp/trait.PartialEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl PartialEq for FormError"],["impl PartialEq for ShareError"],["impl PartialEq for MultiError"],["impl PartialEq for Error"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/convert/trait.From.js b/trait.impl/core/convert/trait.From.js new file mode 100644 index 000000000..c96659bef --- /dev/null +++ b/trait.impl/core/convert/trait.From.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl From<ShareError> for Error"],["impl From<pollfd> for WaitFd"],["impl From<FormError> for Error"],["impl From<NulError> for Error"],["impl From<MultiError> for Error"],["impl From<Error> for Error"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/error/trait.Error.js b/trait.impl/core/error/trait.Error.js new file mode 100644 index 000000000..1f133002f --- /dev/null +++ b/trait.impl/core/error/trait.Error.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl Error for ShareError"],["impl Error for MultiError"],["impl Error for FormError"],["impl Error for Error"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Debug.js b/trait.impl/core/fmt/trait.Debug.js new file mode 100644 index 000000000..37b14d134 --- /dev/null +++ b/trait.impl/core/fmt/trait.Debug.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl Debug for MultiError"],["impl Debug for Events"],["impl Debug for Version"],["impl<'easy, 'data> Debug for Transfer<'easy, 'data>"],["impl Debug for List"],["impl<'a> Debug for Message<'a>"],["impl Debug for Multi"],["impl Debug for SeekResult"],["impl Debug for NetRc"],["impl<'a> Debug for Protocols<'a>"],["impl Debug for FormError"],["impl Debug for SslVersion"],["impl Debug for InfoType"],["impl<H: Debug> Debug for Easy2<H>"],["impl Debug for TimeCondition"],["impl Debug for Auth"],["impl Debug for IpResolve"],["impl Debug for SslOpt"],["impl Debug for Easy"],["impl<'form, 'data> Debug for Part<'form, 'data>"],["impl Debug for WriteError"],["impl<H: Debug> Debug for Easy2Handle<H>"],["impl Debug for WaitFd"],["impl Debug for HttpVersion"],["impl Debug for Form"],["impl Debug for EasyHandle"],["impl Debug for PostRedirections"],["impl Debug for SocketEvents"],["impl Debug for MultiWaker"],["impl Debug for ReadError"],["impl Debug for ShareError"],["impl<'a> Debug for Iter<'a>"],["impl Debug for Error"],["impl Debug for ProxyType"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Display.js b/trait.impl/core/fmt/trait.Display.js new file mode 100644 index 000000000..bbe7d1108 --- /dev/null +++ b/trait.impl/core/fmt/trait.Display.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl Display for MultiError"],["impl Display for Error"],["impl Display for ShareError"],["impl Display for FormError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/collect/trait.IntoIterator.js b/trait.impl/core/iter/traits/collect/trait.IntoIterator.js new file mode 100644 index 000000000..2ab70d8ad --- /dev/null +++ b/trait.impl/core/iter/traits/collect/trait.IntoIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl<'a> IntoIterator for &'a List"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/iterator/trait.Iterator.js b/trait.impl/core/iter/traits/iterator/trait.Iterator.js new file mode 100644 index 000000000..bba8cd7e0 --- /dev/null +++ b/trait.impl/core/iter/traits/iterator/trait.Iterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl<'a> Iterator for Protocols<'a>"],["impl<'a> Iterator for Iter<'a>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Copy.js b/trait.impl/core/marker/trait.Copy.js new file mode 100644 index 000000000..e24241aee --- /dev/null +++ b/trait.impl/core/marker/trait.Copy.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl Copy for IpResolve"],["impl Copy for ProxyType"],["impl Copy for NetRc"],["impl Copy for HttpVersion"],["impl Copy for TimeCondition"],["impl Copy for InfoType"],["impl Copy for SeekResult"],["impl Copy for SslVersion"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Freeze.js b/trait.impl/core/marker/trait.Freeze.js new file mode 100644 index 000000000..16151c197 --- /dev/null +++ b/trait.impl/core/marker/trait.Freeze.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl Freeze for Error",1,["curl::error::Error"]],["impl Freeze for ShareError",1,["curl::error::ShareError"]],["impl Freeze for MultiError",1,["curl::error::MultiError"]],["impl Freeze for FormError",1,["curl::error::FormError"]],["impl Freeze for Version",1,["curl::version::Version"]],["impl<'a> Freeze for Protocols<'a>",1,["curl::version::Protocols"]],["impl Freeze for Form",1,["curl::easy::form::Form"]],["impl<'form, 'data> Freeze for Part<'form, 'data>",1,["curl::easy::form::Part"]],["impl Freeze for Easy",1,["curl::easy::handle::Easy"]],["impl<'easy, 'data> Freeze for Transfer<'easy, 'data>",1,["curl::easy::handle::Transfer"]],["impl<H> Freeze for Easy2<H>",1,["curl::easy::handler::Easy2"]],["impl Freeze for ProxyType",1,["curl::easy::handler::ProxyType"]],["impl Freeze for TimeCondition",1,["curl::easy::handler::TimeCondition"]],["impl Freeze for IpResolve",1,["curl::easy::handler::IpResolve"]],["impl Freeze for HttpVersion",1,["curl::easy::handler::HttpVersion"]],["impl Freeze for SslVersion",1,["curl::easy::handler::SslVersion"]],["impl Freeze for SeekResult",1,["curl::easy::handler::SeekResult"]],["impl Freeze for InfoType",1,["curl::easy::handler::InfoType"]],["impl Freeze for ReadError",1,["curl::easy::handler::ReadError"]],["impl Freeze for WriteError",1,["curl::easy::handler::WriteError"]],["impl Freeze for NetRc",1,["curl::easy::handler::NetRc"]],["impl Freeze for Auth",1,["curl::easy::handler::Auth"]],["impl Freeze for SslOpt",1,["curl::easy::handler::SslOpt"]],["impl Freeze for PostRedirections",1,["curl::easy::handler::PostRedirections"]],["impl Freeze for List",1,["curl::easy::list::List"]],["impl<'a> Freeze for Iter<'a>",1,["curl::easy::list::Iter"]],["impl Freeze for Multi",1,["curl::multi::Multi"]],["impl<'multi> Freeze for Message<'multi>",1,["curl::multi::Message"]],["impl Freeze for EasyHandle",1,["curl::multi::EasyHandle"]],["impl<H> Freeze for Easy2Handle<H>",1,["curl::multi::Easy2Handle"]],["impl Freeze for Events",1,["curl::multi::Events"]],["impl Freeze for SocketEvents",1,["curl::multi::SocketEvents"]],["impl Freeze for WaitFd",1,["curl::multi::WaitFd"]],["impl Freeze for MultiWaker",1,["curl::multi::MultiWaker"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Send.js b/trait.impl/core/marker/trait.Send.js new file mode 100644 index 000000000..2f54570a2 --- /dev/null +++ b/trait.impl/core/marker/trait.Send.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl Send for Error",1,["curl::error::Error"]],["impl Send for ShareError",1,["curl::error::ShareError"]],["impl Send for MultiError",1,["curl::error::MultiError"]],["impl Send for FormError",1,["curl::error::FormError"]],["impl<'a> !Send for Protocols<'a>",1,["curl::version::Protocols"]],["impl !Send for Form",1,["curl::easy::form::Form"]],["impl<'form, 'data> !Send for Part<'form, 'data>",1,["curl::easy::form::Part"]],["impl Send for Easy",1,["curl::easy::handle::Easy"]],["impl<'easy, 'data> !Send for Transfer<'easy, 'data>",1,["curl::easy::handle::Transfer"]],["impl<H> Send for Easy2<H>
where\n H: Send,
",1,["curl::easy::handler::Easy2"]],["impl Send for ProxyType",1,["curl::easy::handler::ProxyType"]],["impl Send for TimeCondition",1,["curl::easy::handler::TimeCondition"]],["impl Send for IpResolve",1,["curl::easy::handler::IpResolve"]],["impl Send for HttpVersion",1,["curl::easy::handler::HttpVersion"]],["impl Send for SslVersion",1,["curl::easy::handler::SslVersion"]],["impl Send for SeekResult",1,["curl::easy::handler::SeekResult"]],["impl Send for InfoType",1,["curl::easy::handler::InfoType"]],["impl Send for ReadError",1,["curl::easy::handler::ReadError"]],["impl Send for WriteError",1,["curl::easy::handler::WriteError"]],["impl Send for NetRc",1,["curl::easy::handler::NetRc"]],["impl Send for Auth",1,["curl::easy::handler::Auth"]],["impl Send for SslOpt",1,["curl::easy::handler::SslOpt"]],["impl Send for PostRedirections",1,["curl::easy::handler::PostRedirections"]],["impl<'a> !Send for Iter<'a>",1,["curl::easy::list::Iter"]],["impl !Send for Multi",1,["curl::multi::Multi"]],["impl<'multi> !Send for Message<'multi>",1,["curl::multi::Message"]],["impl !Send for EasyHandle",1,["curl::multi::EasyHandle"]],["impl<H> !Send for Easy2Handle<H>",1,["curl::multi::Easy2Handle"]],["impl Send for Events",1,["curl::multi::Events"]],["impl Send for SocketEvents",1,["curl::multi::SocketEvents"]],["impl Send for WaitFd",1,["curl::multi::WaitFd"]],["impl Send for Version"],["impl Send for MultiWaker"],["impl Send for List"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.StructuralPartialEq.js b/trait.impl/core/marker/trait.StructuralPartialEq.js new file mode 100644 index 000000000..3c51e1ecd --- /dev/null +++ b/trait.impl/core/marker/trait.StructuralPartialEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl StructuralPartialEq for FormError"],["impl StructuralPartialEq for MultiError"],["impl StructuralPartialEq for ShareError"],["impl StructuralPartialEq for Error"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Sync.js b/trait.impl/core/marker/trait.Sync.js new file mode 100644 index 000000000..b579cd023 --- /dev/null +++ b/trait.impl/core/marker/trait.Sync.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl Sync for Error",1,["curl::error::Error"]],["impl Sync for ShareError",1,["curl::error::ShareError"]],["impl Sync for MultiError",1,["curl::error::MultiError"]],["impl Sync for FormError",1,["curl::error::FormError"]],["impl<'a> !Sync for Protocols<'a>",1,["curl::version::Protocols"]],["impl !Sync for Form",1,["curl::easy::form::Form"]],["impl<'form, 'data> !Sync for Part<'form, 'data>",1,["curl::easy::form::Part"]],["impl !Sync for Easy",1,["curl::easy::handle::Easy"]],["impl<'easy, 'data> !Sync for Transfer<'easy, 'data>",1,["curl::easy::handle::Transfer"]],["impl<H> !Sync for Easy2<H>",1,["curl::easy::handler::Easy2"]],["impl Sync for ProxyType",1,["curl::easy::handler::ProxyType"]],["impl Sync for TimeCondition",1,["curl::easy::handler::TimeCondition"]],["impl Sync for IpResolve",1,["curl::easy::handler::IpResolve"]],["impl Sync for HttpVersion",1,["curl::easy::handler::HttpVersion"]],["impl Sync for SslVersion",1,["curl::easy::handler::SslVersion"]],["impl Sync for SeekResult",1,["curl::easy::handler::SeekResult"]],["impl Sync for InfoType",1,["curl::easy::handler::InfoType"]],["impl Sync for ReadError",1,["curl::easy::handler::ReadError"]],["impl Sync for WriteError",1,["curl::easy::handler::WriteError"]],["impl Sync for NetRc",1,["curl::easy::handler::NetRc"]],["impl Sync for Auth",1,["curl::easy::handler::Auth"]],["impl Sync for SslOpt",1,["curl::easy::handler::SslOpt"]],["impl Sync for PostRedirections",1,["curl::easy::handler::PostRedirections"]],["impl !Sync for List",1,["curl::easy::list::List"]],["impl<'a> !Sync for Iter<'a>",1,["curl::easy::list::Iter"]],["impl !Sync for Multi",1,["curl::multi::Multi"]],["impl<'multi> !Sync for Message<'multi>",1,["curl::multi::Message"]],["impl !Sync for EasyHandle",1,["curl::multi::EasyHandle"]],["impl<H> !Sync for Easy2Handle<H>",1,["curl::multi::Easy2Handle"]],["impl Sync for Events",1,["curl::multi::Events"]],["impl Sync for SocketEvents",1,["curl::multi::SocketEvents"]],["impl Sync for WaitFd",1,["curl::multi::WaitFd"]],["impl Sync for Version"],["impl Sync for MultiWaker"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Unpin.js b/trait.impl/core/marker/trait.Unpin.js new file mode 100644 index 000000000..e1d1252ff --- /dev/null +++ b/trait.impl/core/marker/trait.Unpin.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl Unpin for Error",1,["curl::error::Error"]],["impl Unpin for ShareError",1,["curl::error::ShareError"]],["impl Unpin for MultiError",1,["curl::error::MultiError"]],["impl Unpin for FormError",1,["curl::error::FormError"]],["impl Unpin for Version",1,["curl::version::Version"]],["impl<'a> Unpin for Protocols<'a>",1,["curl::version::Protocols"]],["impl Unpin for Form",1,["curl::easy::form::Form"]],["impl<'form, 'data> Unpin for Part<'form, 'data>",1,["curl::easy::form::Part"]],["impl Unpin for Easy",1,["curl::easy::handle::Easy"]],["impl<'easy, 'data> Unpin for Transfer<'easy, 'data>",1,["curl::easy::handle::Transfer"]],["impl<H> Unpin for Easy2<H>",1,["curl::easy::handler::Easy2"]],["impl Unpin for ProxyType",1,["curl::easy::handler::ProxyType"]],["impl Unpin for TimeCondition",1,["curl::easy::handler::TimeCondition"]],["impl Unpin for IpResolve",1,["curl::easy::handler::IpResolve"]],["impl Unpin for HttpVersion",1,["curl::easy::handler::HttpVersion"]],["impl Unpin for SslVersion",1,["curl::easy::handler::SslVersion"]],["impl Unpin for SeekResult",1,["curl::easy::handler::SeekResult"]],["impl Unpin for InfoType",1,["curl::easy::handler::InfoType"]],["impl Unpin for ReadError",1,["curl::easy::handler::ReadError"]],["impl Unpin for WriteError",1,["curl::easy::handler::WriteError"]],["impl Unpin for NetRc",1,["curl::easy::handler::NetRc"]],["impl Unpin for Auth",1,["curl::easy::handler::Auth"]],["impl Unpin for SslOpt",1,["curl::easy::handler::SslOpt"]],["impl Unpin for PostRedirections",1,["curl::easy::handler::PostRedirections"]],["impl Unpin for List",1,["curl::easy::list::List"]],["impl<'a> Unpin for Iter<'a>",1,["curl::easy::list::Iter"]],["impl Unpin for Multi",1,["curl::multi::Multi"]],["impl<'multi> Unpin for Message<'multi>",1,["curl::multi::Message"]],["impl Unpin for EasyHandle",1,["curl::multi::EasyHandle"]],["impl<H> Unpin for Easy2Handle<H>",1,["curl::multi::Easy2Handle"]],["impl Unpin for Events",1,["curl::multi::Events"]],["impl Unpin for SocketEvents",1,["curl::multi::SocketEvents"]],["impl Unpin for WaitFd",1,["curl::multi::WaitFd"]],["impl Unpin for MultiWaker",1,["curl::multi::MultiWaker"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/drop/trait.Drop.js b/trait.impl/core/ops/drop/trait.Drop.js new file mode 100644 index 000000000..7bcaa80b2 --- /dev/null +++ b/trait.impl/core/ops/drop/trait.Drop.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl Drop for List"],["impl<'easy, 'data> Drop for Transfer<'easy, 'data>"],["impl<H> Drop for Easy2<H>"],["impl Drop for Form"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js new file mode 100644 index 000000000..9baf7b10e --- /dev/null +++ b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl RefUnwindSafe for Error",1,["curl::error::Error"]],["impl RefUnwindSafe for ShareError",1,["curl::error::ShareError"]],["impl RefUnwindSafe for MultiError",1,["curl::error::MultiError"]],["impl RefUnwindSafe for FormError",1,["curl::error::FormError"]],["impl RefUnwindSafe for Version",1,["curl::version::Version"]],["impl<'a> RefUnwindSafe for Protocols<'a>",1,["curl::version::Protocols"]],["impl RefUnwindSafe for Form",1,["curl::easy::form::Form"]],["impl<'form, 'data> RefUnwindSafe for Part<'form, 'data>",1,["curl::easy::form::Part"]],["impl !RefUnwindSafe for Easy",1,["curl::easy::handle::Easy"]],["impl<'easy, 'data> !RefUnwindSafe for Transfer<'easy, 'data>",1,["curl::easy::handle::Transfer"]],["impl<H> !RefUnwindSafe for Easy2<H>",1,["curl::easy::handler::Easy2"]],["impl RefUnwindSafe for ProxyType",1,["curl::easy::handler::ProxyType"]],["impl RefUnwindSafe for TimeCondition",1,["curl::easy::handler::TimeCondition"]],["impl RefUnwindSafe for IpResolve",1,["curl::easy::handler::IpResolve"]],["impl RefUnwindSafe for HttpVersion",1,["curl::easy::handler::HttpVersion"]],["impl RefUnwindSafe for SslVersion",1,["curl::easy::handler::SslVersion"]],["impl RefUnwindSafe for SeekResult",1,["curl::easy::handler::SeekResult"]],["impl RefUnwindSafe for InfoType",1,["curl::easy::handler::InfoType"]],["impl RefUnwindSafe for ReadError",1,["curl::easy::handler::ReadError"]],["impl RefUnwindSafe for WriteError",1,["curl::easy::handler::WriteError"]],["impl RefUnwindSafe for NetRc",1,["curl::easy::handler::NetRc"]],["impl RefUnwindSafe for Auth",1,["curl::easy::handler::Auth"]],["impl RefUnwindSafe for SslOpt",1,["curl::easy::handler::SslOpt"]],["impl RefUnwindSafe for PostRedirections",1,["curl::easy::handler::PostRedirections"]],["impl RefUnwindSafe for List",1,["curl::easy::list::List"]],["impl<'a> RefUnwindSafe for Iter<'a>",1,["curl::easy::list::Iter"]],["impl !RefUnwindSafe for Multi",1,["curl::multi::Multi"]],["impl<'multi> !RefUnwindSafe for Message<'multi>",1,["curl::multi::Message"]],["impl !RefUnwindSafe for EasyHandle",1,["curl::multi::EasyHandle"]],["impl<H> !RefUnwindSafe for Easy2Handle<H>",1,["curl::multi::Easy2Handle"]],["impl RefUnwindSafe for Events",1,["curl::multi::Events"]],["impl RefUnwindSafe for SocketEvents",1,["curl::multi::SocketEvents"]],["impl RefUnwindSafe for WaitFd",1,["curl::multi::WaitFd"]],["impl RefUnwindSafe for MultiWaker",1,["curl::multi::MultiWaker"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js new file mode 100644 index 000000000..85b8b4f4d --- /dev/null +++ b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"curl":[["impl UnwindSafe for Error",1,["curl::error::Error"]],["impl UnwindSafe for ShareError",1,["curl::error::ShareError"]],["impl UnwindSafe for MultiError",1,["curl::error::MultiError"]],["impl UnwindSafe for FormError",1,["curl::error::FormError"]],["impl UnwindSafe for Version",1,["curl::version::Version"]],["impl<'a> UnwindSafe for Protocols<'a>",1,["curl::version::Protocols"]],["impl UnwindSafe for Form",1,["curl::easy::form::Form"]],["impl<'form, 'data> !UnwindSafe for Part<'form, 'data>",1,["curl::easy::form::Part"]],["impl !UnwindSafe for Easy",1,["curl::easy::handle::Easy"]],["impl<'easy, 'data> !UnwindSafe for Transfer<'easy, 'data>",1,["curl::easy::handle::Transfer"]],["impl<H> UnwindSafe for Easy2<H>
where\n H: UnwindSafe,
",1,["curl::easy::handler::Easy2"]],["impl UnwindSafe for ProxyType",1,["curl::easy::handler::ProxyType"]],["impl UnwindSafe for TimeCondition",1,["curl::easy::handler::TimeCondition"]],["impl UnwindSafe for IpResolve",1,["curl::easy::handler::IpResolve"]],["impl UnwindSafe for HttpVersion",1,["curl::easy::handler::HttpVersion"]],["impl UnwindSafe for SslVersion",1,["curl::easy::handler::SslVersion"]],["impl UnwindSafe for SeekResult",1,["curl::easy::handler::SeekResult"]],["impl UnwindSafe for InfoType",1,["curl::easy::handler::InfoType"]],["impl UnwindSafe for ReadError",1,["curl::easy::handler::ReadError"]],["impl UnwindSafe for WriteError",1,["curl::easy::handler::WriteError"]],["impl UnwindSafe for NetRc",1,["curl::easy::handler::NetRc"]],["impl UnwindSafe for Auth",1,["curl::easy::handler::Auth"]],["impl UnwindSafe for SslOpt",1,["curl::easy::handler::SslOpt"]],["impl UnwindSafe for PostRedirections",1,["curl::easy::handler::PostRedirections"]],["impl UnwindSafe for List",1,["curl::easy::list::List"]],["impl<'a> UnwindSafe for Iter<'a>",1,["curl::easy::list::Iter"]],["impl !UnwindSafe for Multi",1,["curl::multi::Multi"]],["impl<'multi> !UnwindSafe for Message<'multi>",1,["curl::multi::Message"]],["impl !UnwindSafe for EasyHandle",1,["curl::multi::EasyHandle"]],["impl<H> !UnwindSafe for Easy2Handle<H>",1,["curl::multi::Easy2Handle"]],["impl UnwindSafe for Events",1,["curl::multi::Events"]],["impl UnwindSafe for SocketEvents",1,["curl::multi::SocketEvents"]],["impl UnwindSafe for WaitFd",1,["curl::multi::WaitFd"]],["impl UnwindSafe for MultiWaker",1,["curl::multi::MultiWaker"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/type.impl/curl_sys/type.curl_socket_t.js b/type.impl/curl_sys/type.curl_socket_t.js new file mode 100644 index 000000000..83d0a7f65 --- /dev/null +++ b/type.impl/curl_sys/type.curl_socket_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"curl":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file