pub struct Dependency { /* fields omitted */ }
Information about a dependency requested by a Cargo manifest.
Cheap to copy.
Attempt to create a Dependency
from an entry in the manifest.
Attempt to create a Dependency
from an entry in the manifest.
This is the name of this Dependency
as listed in Cargo.toml
.
Or in other words, this is what shows up in the [dependencies]
section
on the left hand side. This is not the name of the package that's
being depended on as the dependency can be renamed. For that use
package_name
below.
Both of the dependencies below return foo
for name_in_toml
:
[dependencies]
foo = "0.1"
and ...
[dependencies]
foo = { version = "0.1", package = 'bar' }
The name of the package that this Dependency
depends on.
Usually this is what's written on the left hand side of a dependencies
section, but it can also be renamed via the package
key.
Both of the dependencies below return foo
for package_name
:
[dependencies]
foo = "0.1"
and ...
[dependencies]
bar = { version = "0.1", package = 'foo' }
If none, this dependencies must be built for all platforms.
If some, it must only be built for the specified platform.
The renamed name of this dependency, if any.
If the package
key is used in Cargo.toml
then this returns the same
value as name_in_toml
.
Sets the list of features requested for the package.
Sets whether the dependency requests default features of the package.
Sets whether the dependency is optional.
Set the source id for this dependency
Set the version requirement for this dependency
Lock this dependency to depending on the specified package id
Returns whether this is a "locked" dependency, basically whether it has
an exact version req.
Returns false if the dependency is only used to build the local package.
Returns true if the default features of the dependency are requested.
Returns the list of features that are requested by the dependency.
Returns true if the package (sum
) can fulfill this dependency request.
Returns true if the package (sum
) can fulfill this dependency request.
Returns true if the package (id
) can fulfill this dependency request.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more
Serialize this value into the given Serde serializer. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static