pub struct CargoOptions<'a> { /* private fields */ }
Expand description
Options for queries which simulate what Cargo does.
This provides control over the resolution algorithm used by guppy
’s simulation of Cargo.
Implementations§
source§impl<'a> CargoOptions<'a>
impl<'a> CargoOptions<'a>
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new CargoOptions
with this resolver version and default settings.
The default settings are similar to what a plain cargo build
does:
- use version 1 of the Cargo resolver
- exclude dev-dependencies
- do not build proc macros specified in the query on the target platform
- resolve dependencies assuming any possible host or target platform
- do not omit any packages.
sourcepub fn set_resolver(&mut self, resolver: CargoResolverVersion) -> &mut Self
pub fn set_resolver(&mut self, resolver: CargoResolverVersion) -> &mut Self
Sets the Cargo feature resolver version.
For more about feature resolution, see the documentation for CargoResolverVersion
.
sourcepub fn set_include_dev(&mut self, include_dev: bool) -> &mut Self
pub fn set_include_dev(&mut self, include_dev: bool) -> &mut Self
If set to true, causes dev-dependencies of the initial set to be followed.
This does not affect transitive dependencies – for example, a build or dev-dependency’s further dev-dependencies are never followed.
The default is false, which matches what a plain cargo build
does.
sourcepub fn set_initials_platform(
&mut self,
initials_platform: InitialsPlatform,
) -> &mut Self
pub fn set_initials_platform( &mut self, initials_platform: InitialsPlatform, ) -> &mut Self
Configures the way initials are treated on the target and the host.
The default is a “standard” build and this does not usually need to be set, but some
advanced use cases may require it. For more about this option, see the documentation for
InitialsPlatform
.
sourcepub fn set_platform(
&mut self,
platform_spec: impl Into<PlatformSpec>,
) -> &mut Self
pub fn set_platform( &mut self, platform_spec: impl Into<PlatformSpec>, ) -> &mut Self
Sets both the target and host platforms to the provided spec.
sourcepub fn set_target_platform(
&mut self,
target_platform: impl Into<PlatformSpec>,
) -> &mut Self
pub fn set_target_platform( &mut self, target_platform: impl Into<PlatformSpec>, ) -> &mut Self
Sets the target platform to the provided spec.
sourcepub fn set_host_platform(
&mut self,
host_platform: impl Into<PlatformSpec>,
) -> &mut Self
pub fn set_host_platform( &mut self, host_platform: impl Into<PlatformSpec>, ) -> &mut Self
Sets the host platform to the provided spec.
sourcepub fn add_omitted_packages(
&mut self,
package_ids: impl IntoIterator<Item = &'a PackageId>,
) -> &mut Self
pub fn add_omitted_packages( &mut self, package_ids: impl IntoIterator<Item = &'a PackageId>, ) -> &mut Self
Omits edges into the given packages.
This may be useful in order to figure out what additional dependencies or features a particular set of packages pulls in.
This method is additive.
Trait Implementations§
source§impl<'a> Clone for CargoOptions<'a>
impl<'a> Clone for CargoOptions<'a>
source§fn clone(&self) -> CargoOptions<'a>
fn clone(&self) -> CargoOptions<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for CargoOptions<'a>
impl<'a> Debug for CargoOptions<'a>
Auto Trait Implementations§
impl<'a> Freeze for CargoOptions<'a>
impl<'a> RefUnwindSafe for CargoOptions<'a>
impl<'a> Send for CargoOptions<'a>
impl<'a> Sync for CargoOptions<'a>
impl<'a> Unpin for CargoOptions<'a>
impl<'a> UnwindSafe for CargoOptions<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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>
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>
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