gix_transport::client::http

Struct Options

source
pub struct Options {
Show 16 fields pub extra_headers: Vec<String>, pub follow_redirects: FollowRedirects, pub low_speed_limit_bytes_per_second: u32, pub low_speed_time_seconds: u64, pub proxy: Option<String>, pub no_proxy: Option<String>, pub proxy_auth_method: ProxyAuthMethod, pub proxy_authenticate: Option<(Action, Arc<Mutex<AuthenticateFn>>)>, pub user_agent: Option<String>, pub connect_timeout: Option<Duration>, pub verbose: bool, pub ssl_ca_info: Option<PathBuf>, pub ssl_version: Option<SslVersionRangeInclusive>, pub ssl_verify: bool, pub http_version: Option<HttpVersion>, pub backend: Option<Arc<Mutex<dyn Any + Send + Sync + 'static>>>,
}
Available on crate features blocking-client and http-client only.
Expand description

Options to configure http requests.

Fields§

§extra_headers: Vec<String>

Headers to be added to every request. They are applied unconditionally and are expected to be valid as they occur in an HTTP request, like header: value, without newlines.

Refers to http.extraHeader multi-var.

§follow_redirects: FollowRedirects

How to handle redirects.

Refers to http.followRedirects.

§low_speed_limit_bytes_per_second: u32

Used in conjunction with low_speed_time_seconds, any non-0 value signals the amount of bytes per second at least to avoid aborting the connection.

Refers to http.lowSpeedLimit.

§low_speed_time_seconds: u64

Used in conjunction with low_speed_bytes_per_second, any non-0 value signals the amount seconds the minimal amount of bytes per second isn’t reached.

Refers to http.lowSpeedTime.

§proxy: Option<String>

A curl-style proxy declaration of the form [protocol://][user[:password]@]proxyhost[:port].

Note that an empty string means the proxy is disabled entirely. Refers to http.proxy.

§no_proxy: Option<String>

The comma-separated list of hosts to not send through the proxy, or * to entirely disable all proxying.

§proxy_auth_method: ProxyAuthMethod

The way to authenticate against the proxy if the proxy field contains a username.

Refers to http.proxyAuthMethod.

§proxy_authenticate: Option<(Action, Arc<Mutex<AuthenticateFn>>)>

If authentication is needed for the proxy as its URL contains a username, this method must be set to provide a password for it before making the request, and to store it if the connection succeeds.

§user_agent: Option<String>

The HTTP USER_AGENT string presented to an HTTP server, notably not the user agent present to the git server.

If not overridden, it defaults to the user agent provided by curl, which is a deviation from how git handles this. Thus it’s expected from the callers to set it to their application, or use higher-level crates which make it easy to do this more correctly.

Using the correct user-agent might affect how the server treats the request.

Refers to http.userAgent.

§connect_timeout: Option<Duration>

The amount of time we wait until aborting a connection attempt.

If None, this typically defaults to 2 minutes to 5 minutes. Refers to gitoxide.http.connectTimeout.

§verbose: bool

If enabled, emit additional information about connections and possibly the data received or written.

§ssl_ca_info: Option<PathBuf>

If set, use this path to point to a file with CA certificates to verify peers.

§ssl_version: Option<SslVersionRangeInclusive>

The SSL version or version range to use, or None to let the TLS backend determine which versions are acceptable.

§ssl_verify: bool

Controls whether to perform SSL identity verification or not. Turning this off is not recommended and can lead to various security risks. An example where this may be needed is when an internal git server uses a self-signed certificate and the user accepts the associated security risks.

§http_version: Option<HttpVersion>

The HTTP version to enforce. If unset, it is implementation defined.

§backend: Option<Arc<Mutex<dyn Any + Send + Sync + 'static>>>

Backend specific options, if available.

Trait Implementations§

source§

impl Clone for Options

source§

fn clone(&self) -> Options

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 Default for Options

source§

fn default() -> Self

Returns the “default value” for a type. 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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

source§

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>,

source§

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>,

source§

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.