pub struct RegistrySource<'cfg> {
    source_id: SourceId,
    src_path: Filesystem,
    config: &'cfg Config,
    ops: Box<dyn RegistryData + 'cfg>,
    index: RegistryIndex<'cfg>,
    yanked_whitelist: HashSet<PackageId>,
}
Expand description

A “source” for a local (see local::LocalRegistry) or remote (see remote::RemoteRegistry) registry.

This contains common functionality that is shared between the two registry kinds, with the registry-specific logic implemented as part of the RegistryData trait referenced via the ops field.

Fields§

§source_id: SourceId§src_path: Filesystem

The path where crate files are extracted ($CARGO_HOME/registry/src/$REG-HASH).

§config: &'cfg Config

Local reference to Config for convenience.

§ops: Box<dyn RegistryData + 'cfg>

Abstraction for interfacing to the different registry kinds.

§index: RegistryIndex<'cfg>

Interface for managing the on-disk index.

§yanked_whitelist: HashSet<PackageId>

A set of packages that should be allowed to be used, even if they are yanked.

This is populated from the entries in Cargo.lock to ensure that cargo update -p somepkg won’t unlock yanked entries in Cargo.lock. Otherwise, the resolver would think that those entries no longer exist, and it would trigger updates to unrelated packages.

Implementations§

Decode the configuration stored within the registry.

This requires that the index has been at least checked out.

Unpacks a downloaded package into a location where it’s ready to be compiled.

No action is taken if the source looks like it’s already unpacked.

Trait Implementations§

Attempts to find the packages that match a dependency request.
Returns whether or not this source will return summaries with checksums listed.
Returns whether or not this source will return summaries with the precise field in the source id listed.
Returns the SourceId corresponding to this source.
Ensure that the source is fully up-to-date for the current session on the next query.
Fetches the full package for each name and version specified.
Generates a unique string which represents the fingerprint of the current state of the source. Read more
Describes this source in a human readable fashion, used for display in resolver error messages currently.
Add a number of crates that should be whitelisted for showing up during queries, even if they are yanked. Currently only applies to registry sources.
Query if a package is yanked. Only registry sources can mark packages as yanked. This ignores the yanked whitelist.
Block until all outstanding Poll::Pending requests are Poll::Ready. Read more
Returns the replaced SourceId corresponding to this source.
If this source supports it, verifies the source of the package specified. Read more
Returns whether a source is being replaced by another here.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

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: 192 bytes