pub struct PackageId {
pub name: String,
pub version: String,
pub source: Option<String>,
}Expand description
A fully-qualified package identity: name@version plus its source registry.
Fields§
§name: String§version: String§source: Option<String>Implementations§
Source§impl PackageId
impl PackageId
Sourcepub fn is_local(&self) -> bool
pub fn is_local(&self) -> bool
A package with no source is a local/workspace crate, not a registry dep.
Sourcepub fn is_crates_io(&self) -> bool
pub fn is_crates_io(&self) -> bool
True only for packages sourced from the default crates.io registry.
RustSec advisories are keyed to crates.io, so a git, path, or alternate-registry crate that merely shares a name with an advised crate must not be matched against it (matches cargo-audit behaviour).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PackageId
impl<'de> Deserialize<'de> for PackageId
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
impl Eq for PackageId
Source§impl Ord for PackageId
impl Ord for PackageId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for PackageId
impl PartialOrd for PackageId
impl StructuralPartialEq for PackageId
Auto Trait Implementations§
impl Freeze for PackageId
impl RefUnwindSafe for PackageId
impl Send for PackageId
impl Sync for PackageId
impl Unpin for PackageId
impl UnsafeUnpin for PackageId
impl UnwindSafe for PackageId
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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§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.