pub struct NodeWeight { /* private fields */ }Expand description
The weight of a node in the dependency graph, representing a crate.
The crate name already has the hyphen - replaced with _ as used in code.
Implementations§
Source§impl NodeWeight
impl NodeWeight
Sourcepub fn short(&self) -> &str
pub fn short(&self) -> &str
Short name of the crate.
For example, if the full name is pugio_lib v1.0.0, this returns pugio_lib.
Sourcepub fn extra(&self) -> &str
pub fn extra(&self) -> &str
Extra information of the crate, including version and potentially path.
For example, if the full name is pugio_lib v1.0.0, this returns v1.0.0.
Sourcepub fn features(&self) -> &BTreeMap<String, Vec<String>>
pub fn features(&self) -> &BTreeMap<String, Vec<String>>
Get the enabled features of the crate.
This returns a map from a feature to features that it directly enable.
For example, if a crate has features:
default = ["a", "b"]a = ["c"]b = []c = []
This returns a map: {("default": ["a", "b"]), ("a": ["c"]), ("b": []), ("c": [])}
This does not include enabled optional dependencies, e.g. feature = ["dep:crate"].
Dependency features, e.g. feature = ["crate/feature"] are represented in EdgeWeight
instead.
Trait Implementations§
Source§impl Clone for NodeWeight
impl Clone for NodeWeight
Source§fn clone(&self) -> NodeWeight
fn clone(&self) -> NodeWeight
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more