Skip to main content

CargoLinkContext

Struct CargoLinkContext 

Source
pub struct CargoLinkContext<'a, 'g> { /* private fields */ }
Expand description

Context passed to a CargoLinkVisitor for each link visited while building a CargoSet.

Implementations§

Source§

impl<'a, 'g> CargoLinkContext<'a, 'g>

Source

pub fn package_context(&self) -> &PackageLinkContext<'g>

Returns the context for the underlying package graph traversal.

Source

pub fn build_platform(&self) -> BuildPlatform

Returns the platform this link is being evaluated for: the target pass or the host pass.

Source

pub fn platform_spec(&self) -> &PlatformSpec

Returns the platform spec that normal and dev dependencies are evaluated against in this pass.

Source

pub fn build_dep_platform_spec(&self) -> &PlatformSpec

Returns the platform spec that build dependencies are evaluated against in this pass (always the host platform).

Source

pub fn considers_dev_deps(&self, link: &PackageLink<'g>) -> bool

Returns true if dev-dependencies of this link may be followed: CargoOptions::set_include_dev is set and the from package is an initial.

Source

pub fn considers_build_deps(&self, link: &PackageLink<'g>) -> bool

Returns true if build-dependencies of this link may be followed: the from package has a build script.

Trait Implementations§

Source§

impl<'a, 'g> Clone for CargoLinkContext<'a, 'g>

Source§

fn clone(&self) -> CargoLinkContext<'a, 'g>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a, 'g> Debug for CargoLinkContext<'a, 'g>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, 'g> Freeze for CargoLinkContext<'a, 'g>

§

impl<'a, 'g> RefUnwindSafe for CargoLinkContext<'a, 'g>

§

impl<'a, 'g> Send for CargoLinkContext<'a, 'g>

§

impl<'a, 'g> Sync for CargoLinkContext<'a, 'g>

§

impl<'a, 'g> Unpin for CargoLinkContext<'a, 'g>

§

impl<'a, 'g> UnsafeUnpin for CargoLinkContext<'a, 'g>

§

impl<'a, 'g> UnwindSafe for CargoLinkContext<'a, 'g>

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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