[−][src]Struct guppy::graph::cargo::CargoOptions
Options for queries which simulate what Cargo does.
This provides control over the resolution algorithm used by guppy
's simulation of Cargo.
Implementations
impl<'a> CargoOptions<'a>
[src]
pub fn new() -> Self
[src]
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.
pub fn with_version(self, version: CargoResolverVersion) -> Self
[src]
Sets the Cargo feature resolver version.
For more about feature resolution, see the documentation for CargoResolverVersion
.
pub fn with_dev_deps(self, include_dev: bool) -> Self
[src]
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 true, which matches what a plain cargo build
does.
pub fn with_proc_macros_on_target(self, proc_macros_on_target: bool) -> Self
[src]
If set to true, causes procedural macros (and transitive dependencies) specified in the initial set to be built on the host platform as well, not just the target platform.
Procedural macros are typically not built on the target platform, but if they contain binary or test targets they will be.
Procedural macros that are dependencies of the initial set will only be built on the host platform, regardless of whether this configuration is set.
pub fn with_platform(self, platform: Option<impl Obs<'a, Platform<'a>>>) -> Self
[src]
Sets both the target and host platforms to the provided one, or to evaluate against any
platform if None
.
This method accepts an owned Platform<'a>
, a borrowed &'a Platform<'a>
or a shared
Arc<Platform<'static>>
.
Examples
use guppy::graph::cargo::CargoOptions; use guppy::Platform; use std::sync::Arc; let platform = Platform::current(); // Borrowed platform. let _ = CargoOptions::new().with_platform(platform.as_ref()); // Owned platform. let _ = CargoOptions::new().with_platform(platform.clone()); // Shared platform. let _ = CargoOptions::new().with_platform(platform.map(Arc::new));
pub fn with_target_platform(
self,
target_platform: Option<impl Obs<'a, Platform<'a>>>
) -> Self
[src]
self,
target_platform: Option<impl Obs<'a, Platform<'a>>>
) -> Self
Sets the target platform to the provided one, or to evaluate against any platform if None
.
This method accepts an owned Platform<'a>
, a borrowed &'a Platform<'a>
or a shared
Arc<Platform<'static>>
.
pub fn with_host_platform(
self,
host_platform: Option<impl Obs<'a, Platform<'a>>>
) -> Self
[src]
self,
host_platform: Option<impl Obs<'a, Platform<'a>>>
) -> Self
Sets the host platform to the provided one, or to evaluate against any platform if None
.
This method accepts an owned Platform<'a>
, a borrowed &'a Platform<'a>
or a shared
Arc<Platform<'static>>
.
pub fn with_omitted_packages(
self,
package_ids: impl IntoIterator<Item = &'a PackageId>
) -> Self
[src]
self,
package_ids: impl IntoIterator<Item = &'a PackageId>
) -> 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
impl<'a> Clone for CargoOptions<'a>
[src]
fn clone(&self) -> CargoOptions<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Debug for CargoOptions<'a>
[src]
impl<'a> Default for CargoOptions<'a>
[src]
Auto Trait Implementations
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> DefaultFeatures<'a> for T where
T: 'a + Clone + Send + Sync,
[src]
T: 'a + Clone + Send + Sync,
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>
[src]
fn self_address_mut(&mut self) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
[src]
T: 'a + Clone,
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a>
[src]
fn self_address_mut(&mut self) -> *mut ()
[src]
impl<T> SafeBorrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,