[−][src]Struct guppy::graph::PackageMetadata
Information about a specific package in a PackageGraph
.
Most of the metadata is extracted from Cargo.toml
files. See
the Cargo.toml
reference for more
details.
Methods
impl PackageMetadata
[src]
pub fn id(&self) -> &PackageId
[src]
Returns the unique identifier for this package.
pub fn name(&self) -> &str
[src]
Returns the name of this package.
This is the same as the name
field of Cargo.toml
.
pub fn version(&self) -> &Version
[src]
Returns the version of this package as resolved by Cargo.
This is the same as the version
field of Cargo.toml
.
pub fn authors(&self) -> &[String]
[src]
Returns the authors of this package.
This is the same as the authors
field of Cargo.toml
.
pub fn description(&self) -> Option<&str>
[src]
Returns a short description for this package.
This is the same as the description
field of Cargo.toml
.
pub fn license(&self) -> Option<&str>
[src]
Returns an SPDX 2.1 license expression for this package, if specified.
This is the same as the license
field of Cargo.toml
. Note that guppy
does not perform
any validation on this, though crates.io
does if a crate is uploaded there.
pub fn license_file(&self) -> Option<&Path>
[src]
Returns the path to a license file for this package, if specified.
This is the same as the license_file
field of Cargo.toml
. It is typically only specified
for nonstandard licenses.
pub fn manifest_path(&self) -> &Path
[src]
Returns the full path to the Cargo.toml
for this package.
This is specific to the system that cargo metadata
was run on.
pub fn categories(&self) -> &[String]
[src]
Returns categories for this package.
This is the same as the categories
field of Cargo.toml
. For packages on crates.io
,
returned values are guaranteed to be
valid category slugs.
pub fn keywords(&self) -> &[String]
[src]
Returns keywords for this package.
This is the same as the keywords
field of Cargo.toml
.
pub fn readme(&self) -> Option<&Path>
[src]
Returns a path to the README for this package, if specified.
This is the same as the readme
field of Cargo.toml
. The path returned is relative to the
directory the Cargo.toml
is in (i.e. relative to the parent of self.manifest_path()
).
pub fn repository(&self) -> Option<&str>
[src]
Returns the source code repository for this package, if specified.
This is the same as the repository
field of Cargo.toml
.
pub fn edition(&self) -> &str
[src]
Returns the Rust edition this package is written against.
This is the same as the edition
field of Cargo.toml
. It is "2015"
by default.
pub fn metadata_table(&self) -> &JsonValue
[src]
Returns the freeform metadata table for this package.
This is the same as the package.metadata
section of Cargo.toml
. This section is
typically used by tools which would like to store package configuration in Cargo.toml
.
pub fn links(&self) -> Option<&str>
[src]
Returns the name of a native library this package links to, if specified.
This is the same as the links
field of Cargo.toml
. See The links
Manifest
Key in
the Cargo book for more details.
pub fn publish(&self) -> Option<&[String]>
[src]
Returns the list of registries to which this package may be published.
Returns None
if publishing is unrestricted, and Some(&[])
if publishing is forbidden.
This is the same as the publish
field of Cargo.toml
.
pub fn in_workspace(&self) -> bool
[src]
Returns true if this package is in the workspace.
pub fn workspace_path(&self) -> Option<&Path>
[src]
Returns the relative path to this package in the workspace, or None
if this package is
not in the workspace.
pub fn has_default_feature(&self) -> bool
[src]
Returns true if this package has a named feature named default
.
For more about default features, see The [features]
section in
the Cargo reference.
pub fn default_feature_id(&self) -> FeatureId
[src]
Returns the FeatureId
corresponding to the default feature.
pub fn named_features(&self) -> impl Iterator<Item = &str>
[src]
Returns the list of named features available for this package. This will include a feature named "default" if it is defined.
A named feature is listed in the [features]
section of Cargo.toml
. For more, see
the reference.
Trait Implementations
impl Clone for PackageMetadata
[src]
fn clone(&self) -> PackageMetadata
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PackageMetadata
[src]
Auto Trait Implementations
impl RefUnwindSafe for PackageMetadata
impl Send for PackageMetadata
impl Sync for PackageMetadata
impl Unpin for PackageMetadata
impl UnwindSafe for PackageMetadata
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,