Struct guppy::graph::cargo::CargoOptions [−][src]
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 set_version(&mut self, version: CargoResolverVersion) -> &mut Self
[src]
Sets the Cargo feature resolver version.
For more about feature resolution, see the documentation for CargoResolverVersion
.
pub fn set_include_dev(&mut self, include_dev: bool) -> &mut 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 set_initials_platform(
&mut self,
initials_platform: InitialsPlatform
) -> &mut Self
[src]
&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
.
pub fn set_platform(
&mut self,
platform: Option<impl Into<Obs<'a, Platform<'a>>>>
) -> &mut Self
[src]
&mut self,
platform: Option<impl Into<Obs<'a, Platform<'a>>>>
) -> &mut Self
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().set_platform(platform.as_ref()); // Owned platform. let _ = CargoOptions::new().set_platform(platform.clone()); // Shared platform. let _ = CargoOptions::new().set_platform(platform.map(Arc::new));
pub fn set_target_platform(
&mut self,
target_platform: Option<impl Into<Obs<'a, Platform<'a>>>>
) -> &mut Self
[src]
&mut self,
target_platform: Option<impl Into<Obs<'a, Platform<'a>>>>
) -> &mut 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 set_host_platform(
&mut self,
host_platform: Option<impl Into<Obs<'a, Platform<'a>>>>
) -> &mut Self
[src]
&mut self,
host_platform: Option<impl Into<Obs<'a, Platform<'a>>>>
) -> &mut 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 add_omitted_packages(
&mut self,
package_ids: impl IntoIterator<Item = &'a PackageId>
) -> &mut Self
[src]
&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
impl<'a> Clone for CargoOptions<'a>
[src]
fn clone(&self) -> CargoOptions<'a>
[src]
pub 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>
[src]
impl<'a> Send for CargoOptions<'a>
[src]
impl<'a> Sync for CargoOptions<'a>
[src]
impl<'a> Unpin for CargoOptions<'a>
[src]
impl<'a> !UnwindSafe for CargoOptions<'a>
[src]
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,
pub 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,
pub fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a, Global>
[src]
pub 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,
pub fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a, Global>
[src]
pub fn self_address_mut(&mut self) -> *mut ()
[src]
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> SafeBorrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub 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>,