#[non_exhaustive]pub struct FetchSpec<'a> {
pub package_name: &'a str,
pub url: &'a str,
pub sha1: &'a str,
pub dest: &'a Path,
pub partial_dir: &'a Path,
pub auth_header: Option<&'a str>,
pub auth_header_name: Option<&'a str>,
pub progress: &'a dyn Progress,
}Expand description
One dist to fetch: a single URL plus its verification and auth metadata.
The mirror-fallback loop lives in the downloader, which builds a fresh
FetchSpec per candidate URL.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.package_name: &'a strThe package the dist belongs to, for progress and error messages. Empty when the fetch is not for a package (a remote patch).
url: &'a strThe URL to GET. Always http/https — the downloader handles
non-HTTP (type: artifact local file) dists itself.
sha1: &'a strExpected sha1 hex of the archive (lower-case), or the empty string
to skip verification. Composer publishes an empty shasum for
VCS-driver zipballs (GitHub/GitLab/Bitbucket), the common case on
public Packagist; those are fetched unverified, exactly as Composer
does (FileDownloader.php:212).
dest: &'a PathWhere the verified bytes are placed (atomically). Typically the content-addressed dist cache path.
partial_dir: &'a PathDirectory for the in-progress temp file. Should ideally sit on the
same filesystem as dest so the final rename is intra-filesystem;
the default impl also stages a .incoming sibling of dest to
guarantee that even when it isn’t.
auth_header: Option<&'a str>Pre-rendered Authorization header value (e.g. Basic <b64> or
Bearer <tok>), or None for public dists.
auth_header_name: Option<&'a str>Header name for the credential. Defaults to authorization when
None; set to private-token for GitLab private-token auth.
progress: &'a dyn ProgressWhere to report retries (Progress::on_retry).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for FetchSpec<'a>
impl<'a> !UnwindSafe for FetchSpec<'a>
impl<'a> Forget for FetchSpec<'a>
impl<'a> Freeze for FetchSpec<'a>
impl<'a> Move for FetchSpec<'a>
impl<'a> Send for FetchSpec<'a>
impl<'a> Sync for FetchSpec<'a>
impl<'a> Unpin for FetchSpec<'a>
impl<'a> UnsafeUnpin for FetchSpec<'a>
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,
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