pub enum PackageSource {
Registry {
registry: Registry,
registry_name: String,
integrity_hash: Option<String>,
},
Git {
url: String,
rev: String,
subdir: Option<String>,
},
Path {
path: String,
},
Local {
path: String,
overrides: String,
},
}Expand description
One typed source variant per resolution kind every adapter surfaces.
Variants§
Registry
Fetched from an upstream registry (most common case).
Fields
Git
Fetched from a git repository.
Fields
Path
Local path (workspace-relative or absolute).
Local
Local development override ([patch."<registry>"] in Cargo;
npm install file:../foo; etc.). Differs from Path in that
it’s an override of a registry source, not the canonical
source.
Implementations§
Source§impl PackageSource
impl PackageSource
Sourcepub const fn kind_str(&self) -> &'static str
pub const fn kind_str(&self) -> &'static str
Stable string identifier for cache keys + diagnostics.
Sourcepub fn is_content_addressed(&self) -> bool
pub fn is_content_addressed(&self) -> bool
Is this source content-addressed (registry with integrity hash OR git with a commit-rev)? Cache-hit-first only makes sense for content-addressed sources — path + local sources rebuild every time.
Trait Implementations§
Source§impl Clone for PackageSource
impl Clone for PackageSource
Source§fn clone(&self) -> PackageSource
fn clone(&self) -> PackageSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PackageSource
impl Debug for PackageSource
Source§impl<'de> Deserialize<'de> for PackageSource
impl<'de> Deserialize<'de> for PackageSource
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for PackageSource
impl Hash for PackageSource
Source§impl PartialEq for PackageSource
impl PartialEq for PackageSource
Source§fn eq(&self, other: &PackageSource) -> bool
fn eq(&self, other: &PackageSource) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PackageSource
impl Serialize for PackageSource
impl Eq for PackageSource
impl StructuralPartialEq for PackageSource
Auto Trait Implementations§
impl Freeze for PackageSource
impl RefUnwindSafe for PackageSource
impl Send for PackageSource
impl Sync for PackageSource
impl Unpin for PackageSource
impl UnsafeUnpin for PackageSource
impl UnwindSafe for PackageSource
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.