pub struct Package {Show 19 fields
pub name: String,
pub pretty_name: String,
pub version: String,
pub pretty_version: String,
pub package_type: String,
pub stability: &'static str,
pub is_default_branch: bool,
pub source: Option<SourceRef>,
pub dist: Option<SourceRef>,
pub requires: Links,
pub dev_requires: Links,
pub conflicts: Links,
pub provides: Links,
pub replaces: Links,
pub raw: Value,
pub origin: Origin,
pub alias_of: Option<usize>,
pub root_package_alias: bool,
pub has_self_version_requires: bool,
}Fields§
§name: StringLowercased name (getName).
pretty_name: String§version: StringNormalized version (getVersion).
pretty_version: String§package_type: String§stability: &'static str§is_default_branch: bool§source: Option<SourceRef>§dist: Option<SourceRef>§requires: Links§dev_requires: Links§conflicts: Links§provides: Links§replaces: Links§raw: ValueRaw JSON of the version (p2 metadata or lock entry).
origin: Origin§alias_of: Option<usize>AliasPackage: arena index of the aliased package.
root_package_alias: boolAliasPackage::isRootPackageAlias.
has_self_version_requires: boolAliasPackage::hasSelfVersionRequires.
Implementations§
Source§impl Package
impl Package
pub fn new( pretty_name: &str, version: &str, pretty_version: &str, origin: Origin, ) -> Package
pub fn is_alias(&self) -> bool
pub fn is_dev(&self) -> bool
Sourcepub fn names(&self, provides: bool) -> Vec<String>
pub fn names(&self, provides: bool) -> Vec<String>
getNames(): name + targets of provide and replace.
pub fn unique_name(&self) -> String
pub fn pretty_string(&self) -> String
pub fn source_reference(&self) -> Option<&str>
pub fn dist_reference(&self) -> Option<&str>
pub fn links(&self, kind: LinkType) -> &Links
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnsafeUnpin for Package
impl UnwindSafe for Package
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<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> ⓘ
Converts
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> ⓘ
Converts
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