guppy::graph::cargo

Struct CargoOptions

Source
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>

Source

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.
Source

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.

Source

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.

Source

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.

Source

pub fn set_platform( &mut self, platform_spec: impl Into<PlatformSpec>, ) -> &mut Self

Sets both the target and host platforms to the provided spec.

Source

pub fn set_target_platform( &mut self, target_platform: impl Into<PlatformSpec>, ) -> &mut Self

Sets the target platform to the provided spec.

Source

pub fn set_host_platform( &mut self, host_platform: impl Into<PlatformSpec>, ) -> &mut Self

Sets the host platform to the provided spec.

Source

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>

Source§

fn clone(&self) -> CargoOptions<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for CargoOptions<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for CargoOptions<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.