pub struct SolverRequest {
pub requirements: Vec<PackageRequirement>,
pub constraints: Vec<PackageRequirement>,
pub excludes: Vec<String>,
pub platform: Option<String>,
pub arch: Option<String>,
pub metadata: HashMap<String, String>,
}Expand description
Solver request
Fields§
§requirements: Vec<PackageRequirement>Root requirements to resolve
constraints: Vec<PackageRequirement>Additional constraints
excludes: Vec<String>Packages to exclude
platform: Option<String>Platform constraints
arch: Option<String>Architecture constraints
metadata: HashMap<String, String>Request metadata
Implementations§
Source§impl SolverRequest
impl SolverRequest
Sourcepub fn new(requirements: Vec<PackageRequirement>) -> Self
pub fn new(requirements: Vec<PackageRequirement>) -> Self
Create a new solver request
Sourcepub fn with_constraint(self, constraint: PackageRequirement) -> Self
pub fn with_constraint(self, constraint: PackageRequirement) -> Self
Add a constraint
Sourcepub fn with_exclude(self, package_name: String) -> Self
pub fn with_exclude(self, package_name: String) -> Self
Add an exclusion
Sourcepub fn with_platform(self, platform: String) -> Self
pub fn with_platform(self, platform: String) -> Self
Set platform constraint
Trait Implementations§
Source§impl Clone for SolverRequest
impl Clone for SolverRequest
Source§fn clone(&self) -> SolverRequest
fn clone(&self) -> SolverRequest
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 moreAuto Trait Implementations§
impl Freeze for SolverRequest
impl RefUnwindSafe for SolverRequest
impl Send for SolverRequest
impl Sync for SolverRequest
impl Unpin for SolverRequest
impl UnwindSafe for SolverRequest
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more