pub struct DependencySpec {
pub tool_name: String,
pub version_constraint: Option<VersionConstraint>,
pub dependency_type: DependencyType,
pub description: String,
pub optional: bool,
pub platforms: Vec<String>,
}
Expand description
Specification for a dependency
Fields§
§tool_name: String
Name of the dependency tool
version_constraint: Option<VersionConstraint>
Version constraint
dependency_type: DependencyType
Dependency type
description: String
Human-readable description
optional: bool
Whether this dependency is optional
platforms: Vec<String>
Platform-specific constraints
Implementations§
Source§impl DependencySpec
impl DependencySpec
Sourcepub fn required(
tool_name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn required( tool_name: impl Into<String>, description: impl Into<String>, ) -> Self
Create a required runtime dependency
Sourcepub fn optional(
tool_name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn optional( tool_name: impl Into<String>, description: impl Into<String>, ) -> Self
Create an optional dependency
Sourcepub fn build(
tool_name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn build( tool_name: impl Into<String>, description: impl Into<String>, ) -> Self
Create a build-time dependency
Sourcepub fn with_version(self, constraint: impl Into<String>) -> Self
pub fn with_version(self, constraint: impl Into<String>) -> Self
Set version constraint
Sourcepub fn with_version_prerelease(self, constraint: impl Into<String>) -> Self
pub fn with_version_prerelease(self, constraint: impl Into<String>) -> Self
Set version constraint with prerelease support
Sourcepub fn for_platforms(self, platforms: Vec<String>) -> Self
pub fn for_platforms(self, platforms: Vec<String>) -> Self
Set platform constraints
Sourcepub fn applies_to_platform(&self, platform: &str) -> bool
pub fn applies_to_platform(&self, platform: &str) -> bool
Check if this dependency applies to the current platform
Trait Implementations§
Source§impl Clone for DependencySpec
impl Clone for DependencySpec
Source§fn clone(&self) -> DependencySpec
fn clone(&self) -> DependencySpec
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 DependencySpec
impl Debug for DependencySpec
Source§impl<'de> Deserialize<'de> for DependencySpec
impl<'de> Deserialize<'de> for DependencySpec
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 DependencySpec
impl RefUnwindSafe for DependencySpec
impl Send for DependencySpec
impl Sync for DependencySpec
impl Unpin for DependencySpec
impl UnwindSafe for DependencySpec
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