pub struct HttpOptions { /* private fields */ }Expand description
HTTP settings for an update source or for the engine’s downloads: extra request headers and the proxy.
By default no header is added and the proxy comes from the environment
(ALL_PROXY, HTTPS_PROXY, HTTP_PROXY, and their lowercase forms),
as before. Pass the options to the source
(for example StaticManifestSource::http)
for metadata requests, and to EngineConfig::http
for artifacts, deltas, and their checksum and signature files.
use gpui_updater_core::HttpOptions;
let http = HttpOptions::new()
.header("authorization", "Bearer s3cr3t")
.proxy("http://proxy.internal:3128");Implementations§
Source§impl HttpOptions
impl HttpOptions
Sourcepub const fn new() -> HttpOptions
pub const fn new() -> HttpOptions
No extra headers, and the proxy from the environment.
Sourcepub fn header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> HttpOptions
pub fn header( self, name: impl Into<String>, value: impl Into<String>, ) -> HttpOptions
Send name: value with every request.
Put a credential in authorization: it is dropped when a request is
redirected, so a release asset’s storage host never sees it. Every
other header goes to redirect targets as well. A header the source
sets itself, such as the authorization from
GitHubSource::token, takes precedence
over one set here. An invalid name or value fails the request.
Sourcepub fn proxy(self, url: impl Into<String>) -> HttpOptions
pub fn proxy(self, url: impl Into<String>) -> HttpOptions
Send requests through the proxy at url instead of the one from the
environment. The scheme is http, https, socks4, socks4a, or
socks5; credentials go in the URL (http://user:pass@host:port).
HTTPS requests are tunnelled, so TLS still ends at the update server.
An invalid URL fails every request.
Sourcepub fn no_proxy(self) -> HttpOptions
pub fn no_proxy(self) -> HttpOptions
Connect directly, ignoring the proxy environment variables.
Trait Implementations§
Source§impl Clone for HttpOptions
impl Clone for HttpOptions
Source§fn clone(&self) -> HttpOptions
fn clone(&self) -> HttpOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HttpOptions
Shows header names and whether a proxy is set, never header values or the
proxy URL, which may hold credentials.
impl Debug for HttpOptions
Shows header names and whether a proxy is set, never header values or the proxy URL, which may hold credentials.
Source§impl Default for HttpOptions
impl Default for HttpOptions
Source§fn default() -> HttpOptions
fn default() -> HttpOptions
Auto Trait Implementations§
impl Freeze for HttpOptions
impl RefUnwindSafe for HttpOptions
impl Send for HttpOptions
impl Sync for HttpOptions
impl Unpin for HttpOptions
impl UnsafeUnpin for HttpOptions
impl UnwindSafe for HttpOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().