[][src]Struct guppy::graph::PackageMetadata

pub struct PackageMetadata { /* fields omitted */ }

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.

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.

Trait Implementations

impl Clone for PackageMetadata[src]

impl Debug for PackageMetadata[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]