pub struct Proxy {
pub enabled: bool,
pub num_threads: usize,
pub download_on_update: bool,
pub url: Url,
pub index: Url,
pub api: Url,
pub connect_timeout_seconds: u64,
pub request_timeout_seconds: u64,
pub user_agent: String,
}Fields§
§enabled: boolEnable crates.io proxy
num_threads: usizeNumber of proxy threads
download_on_update: boolDownload crates on index update
url: UrlCrates.io download URL
index: UrlCrates.io index URL
api: UrlCrates.io API URL
connect_timeout_seconds: u64Connect timeout in seconds for upstream requests
request_timeout_seconds: u64Request timeout in seconds for upstream downloads
user_agent: StringUser-agent sent with requests to crates.io. crates.io’s data-access policy asks for a user-agent that identifies the application and a way to get in contact, e.g. “kellnr.io/kellnr (contact@example.com)”.
Implementations§
Source§impl Proxy
impl Proxy
Sourcepub fn cratesio_index_override(&self) -> Option<&Url>
pub fn cratesio_index_override(&self) -> Option<&Url>
The upstream sparse-index URL that internal cargo invocations (e.g. the docs builder) should resolve crates.io dependencies from, if it differs from the built-in crates.io default.
Returns None when the proxy is disabled or the default index is in
use. In both cases cargo’s own default (index.crates.io) is correct
and source replacement would be redundant. When Some, callers should
point cargo’s crates-io source at this URL so dependency resolution
honors proxy.index instead of hitting crates.io directly. See #1185.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Proxy
impl<'de> Deserialize<'de> for Proxy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Proxy
Source§impl From<&Proxy> for ProxyPartial
impl From<&Proxy> for ProxyPartial
impl StructuralPartialEq for Proxy
Auto Trait Implementations§
impl Freeze for Proxy
impl RefUnwindSafe for Proxy
impl Send for Proxy
impl Sync for Proxy
impl Unpin for Proxy
impl UnsafeUnpin for Proxy
impl UnwindSafe for Proxy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 more