pub struct WorkspacePackage {
pub package: Package,
pub manifest_path: PathBuf,
pub manifest_dir: PathBuf,
pub deps: Vec<DependencyEdge>,
pub kind: PackageKind,
pub is_port: bool,
}Expand description
A single loaded package.
Fields§
§package: Package§manifest_path: PathBufAbsolute path to this package’s cabin.toml.
manifest_dir: PathBufAbsolute path to the directory containing manifest_path.
deps: Vec<DependencyEdge>Resolved package-dependency edges, in declaration order.
Each edge carries the index of the depended-on package
inside PackageGraph::packages together with the
DependencyKind under which it was declared.
Normal-kind edges always appear here. Dev-kind edges
appear only when the loader was asked to activate this
package’s [dev-dependencies] via
WorkspaceLoadOptions::include_dev_for - cabin test does
that for the selected packages; ordinary commands keep dev
deps declaration-only. The kind is preserved per-edge so
consumers can filter appropriately.
kind: PackageKindWhether this package was loaded from a local source tree or from an extracted registry archive.
is_port: boolWhether this package is a prepared foundation port (its
source tree was materialized from a port.toml recipe).
Ports are also PackageKind::Local - this flag is what
distinguishes them from ordinary path dependencies so
cabin tree / explain can tag them [port].
Implementations§
Source§impl WorkspacePackage
impl WorkspacePackage
Sourcepub fn deps_of_kind(
&self,
kind: DependencyKind,
) -> impl Iterator<Item = usize> + '_
pub fn deps_of_kind( &self, kind: DependencyKind, ) -> impl Iterator<Item = usize> + '_
Iterate dependency edges of a single kind. Used by the
build planner, which resolves ordinary targets through
Normal-kind edges only and additionally lets dev-only
targets (test / example) see activated Dev-kind edges.
Sourcepub fn all_dep_indices(&self) -> impl Iterator<Item = usize> + '_
pub fn all_dep_indices(&self) -> impl Iterator<Item = usize> + '_
Iterate all dependency edges as bare indices, in declaration order. Used by closure walks (resolve / fetch / metadata) that include every package-graph-resident kind.
Trait Implementations§
Source§impl Clone for WorkspacePackage
impl Clone for WorkspacePackage
Source§fn clone(&self) -> WorkspacePackage
fn clone(&self) -> WorkspacePackage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkspacePackage
impl Debug for WorkspacePackage
impl Eq for WorkspacePackage
Source§impl PartialEq for WorkspacePackage
impl PartialEq for WorkspacePackage
Source§fn eq(&self, other: &WorkspacePackage) -> bool
fn eq(&self, other: &WorkspacePackage) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for WorkspacePackage
Auto Trait Implementations§
impl Freeze for WorkspacePackage
impl RefUnwindSafe for WorkspacePackage
impl Send for WorkspacePackage
impl Sync for WorkspacePackage
impl Unpin for WorkspacePackage
impl UnsafeUnpin for WorkspacePackage
impl UnwindSafe for WorkspacePackage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.