struct HttpBackend<'gctx> {Show 14 fields
index_cache_path: Filesystem,
crate_cache_path: Filesystem,
source_id: SourceId,
gctx: &'gctx GlobalContext,
url: Url,
requested_update: Cell<bool>,
progress: RefCell<Option<Progress<'gctx>>>,
pending: Cell<usize>,
fresh: RefCell<HashSet<String>>,
fetch_started: Cell<bool>,
auth_required: Cell<bool>,
login_url: RefCell<Option<Url>>,
auth_error_headers: RefCell<Vec<String>>,
quiet: Cell<bool>,
}Fields§
§index_cache_path: FilesystemPath to the registry index ($CARGO_HOME/registry/index/$REG-HASH).
crate_cache_path: FilesystemPath to the cache of .crate files ($CARGO_HOME/registry/cache/$REG-HASH).
source_id: SourceIdThe unique identifier of this registry source.
gctx: &'gctx GlobalContext§url: UrlStore the server URL without the protocol prefix (sparse+)
requested_update: Cell<bool>Has the client requested a cache update?
Only if they have do we double-check the freshness of each locally-stored index file.
progress: RefCell<Option<Progress<'gctx>>>Progress bar for transfers.
pending: Cell<usize>Number of in-flight requests.
fresh: RefCell<HashSet<String>>What paths have we already fetched since the last index update?
We do not need to double-check any of these index files since we have already done so.
fetch_started: Cell<bool>Have we started to download any index files?
auth_required: Cell<bool>Should we include the authorization header?
login_url: RefCell<Option<Url>>Url to get a token for the registry.
auth_error_headers: RefCell<Vec<String>>Headers received with an HTTP 401.
quiet: Cell<bool>Disables status messages.
Implementations§
Source§impl<'gctx> HttpBackend<'gctx>
impl<'gctx> HttpBackend<'gctx>
pub fn new( source_id: SourceId, gctx: &'gctx GlobalContext, name: &str, ) -> CargoResult<HttpBackend<'gctx>>
Sourcefn start_fetch(&self) -> CargoResult<()>
fn start_fetch(&self) -> CargoResult<()>
Setup the necessary works before the first fetch gets started.
This is a no-op if called more than one time.
Sourcefn offline(&self) -> bool
fn offline(&self) -> bool
Are we in offline mode?
Return NotFound in offline mode when the file doesn’t exist in the cache. If this results in resolution failure, the resolver will suggest removing the –offline flag.
async fn fetch_uncached( &self, path: &str, extra_header: Option<(&HeaderName, &HeaderValue)>, ) -> CargoResult<LoadResponse>
async fn fetch_uncached_no_retry( &self, path: &str, extra_header: Option<(&HeaderName, &HeaderValue)>, ) -> CargoResult<LoadResponse>
Sourcefn tick(&self) -> CargoResult<()>
fn tick(&self) -> CargoResult<()>
Updates the state of the progress bar for downloads.
Auto Trait Implementations§
impl<'gctx> !Freeze for HttpBackend<'gctx>
impl<'gctx> !RefUnwindSafe for HttpBackend<'gctx>
impl<'gctx> Send for HttpBackend<'gctx>
impl<'gctx> !Sync for HttpBackend<'gctx>
impl<'gctx> Unpin for HttpBackend<'gctx>
impl<'gctx> UnsafeUnpin for HttpBackend<'gctx>
impl<'gctx> !UnwindSafe for HttpBackend<'gctx>
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 488 bytes