pub struct DependencyNode {
pub name: String,
pub version: String,
pub source: PackageSource,
pub is_dev: bool,
pub is_optional: bool,
pub features: Vec<String>,
}Expand description
Represents a node in the dependency graph.
Fields§
§name: StringPackage name.
version: StringResolved version.
source: PackageSourcePackage source.
is_dev: boolWhether this is a dev dependency.
is_optional: boolWhether this is an optional dependency.
features: Vec<String>Features enabled for this package.
Implementations§
Source§impl DependencyNode
impl DependencyNode
Sourcepub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
Creates a new dependency node.
Sourcepub fn with_source(self, source: PackageSource) -> Self
pub fn with_source(self, source: PackageSource) -> Self
Sets the package source.
Sourcepub fn as_optional(self) -> Self
pub fn as_optional(self) -> Self
Marks this as an optional dependency.
Sourcepub fn with_features(self, features: Vec<String>) -> Self
pub fn with_features(self, features: Vec<String>) -> Self
Sets the enabled features.
Trait Implementations§
Source§impl Clone for DependencyNode
impl Clone for DependencyNode
Source§fn clone(&self) -> DependencyNode
fn clone(&self) -> DependencyNode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DependencyNode
impl Debug for DependencyNode
Source§impl<'de> Deserialize<'de> for DependencyNode
impl<'de> Deserialize<'de> for DependencyNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DependencyNode
impl RefUnwindSafe for DependencyNode
impl Send for DependencyNode
impl Sync for DependencyNode
impl Unpin for DependencyNode
impl UnsafeUnpin for DependencyNode
impl UnwindSafe for DependencyNode
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
Mutably borrows from an owned value. Read more