[−][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.
Implementations
impl<'g> PackageMetadata<'g>
[src]
pub fn id(&self) -> &'g PackageId
[src]
Returns the unique identifier for this package.
pub fn direct_links_directed(
&self,
direction: DependencyDirection
) -> impl Iterator<Item = PackageLink<'g>> + 'g
[src]
&self,
direction: DependencyDirection
) -> impl Iterator<Item = PackageLink<'g>> + 'g
Returns PackageLink
instances corresponding to the direct dependencies for this package in
the specified direction.
pub fn direct_links(&self) -> impl Iterator<Item = PackageLink<'g>> + 'g
[src]
Returns PackageLink
instances corresponding to the direct dependencies for this package.
pub fn reverse_direct_links(&self) -> impl Iterator<Item = PackageLink<'g>> + 'g
[src]
Returns PackageLink
instances corresponding to the packages that directly depend on this
one.
pub fn name(&self) -> &'g str
[src]
Returns the name of this package.
This is the same as the name
field of Cargo.toml
.
pub fn version(&self) -> &'g 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) -> &'g [String]
[src]
Returns the authors of this package.
This is the same as the authors
field of Cargo.toml
.
pub fn description(&self) -> Option<&'g 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<&'g 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<&'g 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 source(&self) -> PackageSource<'g>
[src]
Returns the source from which this package was retrieved.
This may be the workspace path, an external path, or a registry like crates.io
.
pub fn in_workspace(&self) -> bool
[src]
Returns true if this package is in the workspace.
For more detailed information, use source()
.
pub fn manifest_path(&self) -> &'g 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) -> &'g [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) -> &'g [String]
[src]
Returns keywords for this package.
This is the same as the keywords
field of Cargo.toml
.
pub fn readme(&self) -> Option<&'g 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<&'g 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) -> &'g 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) -> &'g 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<&'g 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<&'g [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 build_targets(&self) -> impl Iterator<Item = BuildTarget<'g>>
[src]
Returns all the build targets for this package.
For more, see Cargo Targets in the Cargo reference.
pub fn build_target(&self, id: &BuildTargetId) -> Option<BuildTarget<'g>>
[src]
Looks up a build target by identifier.
pub fn is_proc_macro(&self) -> bool
[src]
Returns true if this package is a procedural macro.
For more about procedural macros, see Procedural Macros in the Rust reference.
pub fn has_build_script(&self) -> bool
[src]
Returns true if this package has a build script.
Cargo only follows build dependencies if a build script is set.
For more about build scripts, see Build Scripts in the Cargo reference.
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<'g>
[src]
Returns the FeatureId
corresponding to the default feature.
pub fn named_features(&self) -> impl Iterator<Item = &'g str> + 'g
[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<'g> Clone for PackageMetadata<'g>
[src]
fn clone(&self) -> PackageMetadata<'g>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'g> Copy for PackageMetadata<'g>
[src]
impl<'g> Debug for PackageMetadata<'g>
[src]
impl<'g> Eq for PackageMetadata<'g>
[src]
impl<'g> PartialEq<PackageMetadata<'g>> for PackageMetadata<'g>
[src]
PackageMetadata
's PartialEq
implementation uses pointer equality for the PackageGraph
.
Auto Trait Implementations
impl<'g> RefUnwindSafe for PackageMetadata<'g>
impl<'g> Send for PackageMetadata<'g>
impl<'g> Sync for PackageMetadata<'g>
impl<'g> Unpin for PackageMetadata<'g>
impl<'g> UnwindSafe for PackageMetadata<'g>
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<'a, T> DefaultFeatures<'a> for T where
T: 'a + Clone + Send + Sync,
[src]
T: 'a + Clone + Send + Sync,
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>
[src]
fn self_address_mut(&mut self) -> *mut ()
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
[src]
T: 'a + Clone,
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a>
[src]
fn self_address_mut(&mut self) -> *mut ()
[src]
impl<T> SafeBorrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
[src]
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>,