pub struct SingleDependency {
pub package: String,
pub version_constraint: Option<DependencyVersionConstraint>,
pub architectures: Option<(bool, Vec<String>)>,
}Expand description
A dependency of a package.
Fields§
§package: StringPackage the dependency is on.
version_constraint: Option<DependencyVersionConstraint>§architectures: Option<(bool, Vec<String>)>Implementations§
Source§impl SingleDependency
impl SingleDependency
Sourcepub fn parse(s: &str) -> Result<Self>
pub fn parse(s: &str) -> Result<Self>
Parse a single package dependency expression into a SingleDependency.
Sourcepub fn package_satisfies(
&self,
package: &str,
version: &PackageVersion,
architecture: &str,
) -> bool
pub fn package_satisfies( &self, package: &str, version: &PackageVersion, architecture: &str, ) -> bool
Evaluate whether a package satisfies the requirements of this parsed expression.
This takes as arguments the low-level package components needed for checking.
Sourcepub fn package_satisfies_virtual(
&self,
package: &str,
provides: Option<&DependencyVersionConstraint>,
) -> bool
pub fn package_satisfies_virtual( &self, package: &str, provides: Option<&DependencyVersionConstraint>, ) -> bool
Whether a package satisfies a virtual package constraint.
These are processed a bit differently in that architecture doesn’t come into play and version constraints in the source package are optional.
Trait Implementations§
Source§impl Clone for SingleDependency
impl Clone for SingleDependency
Source§fn clone(&self) -> SingleDependency
fn clone(&self) -> SingleDependency
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 SingleDependency
impl Debug for SingleDependency
Source§impl Display for SingleDependency
impl Display for SingleDependency
Source§impl PartialEq for SingleDependency
impl PartialEq for SingleDependency
impl StructuralPartialEq for SingleDependency
Auto Trait Implementations§
impl Freeze for SingleDependency
impl RefUnwindSafe for SingleDependency
impl Send for SingleDependency
impl Sync for SingleDependency
impl Unpin for SingleDependency
impl UnwindSafe for SingleDependency
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.