Struct cargo_edit::Dependency [−][src]
pub struct Dependency {
pub name: String,
pub features: Option<Vec<String>>,
// some fields omitted
}
Expand description
A dependency handled by Cargo
Fields
name: String
The name of the dependency (as it is set in its Cargo.toml
and known to crates.io)
features: Option<Vec<String>>
List of features to add (or None to keep features unchanged).
Implementations
Create a new dependency with a name
Set dependency to a given version
Set dependency to a given repository
Set whether the dependency is optional
Set features as an array of string (does some basic parsing)
Set the value of default-features for the dependency
Set the alias for the dependency
Get the dependency name as defined in the manifest, that is, either the alias (rename field if Some), or the official package name (name field).
Set the value of registry for the dependency
Convert dependency to TOML
Returns a tuple with the dependency’s name and either the version as a String
or the path/git repository as an InlineTable
.
(If the dependency is set as optional
or default-features
is set to false
,
an InlineTable
is returned in any case.)
Panic
Panics if the path is relative
Trait Implementations
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for Dependency
impl Send for Dependency
impl Sync for Dependency
impl Unpin for Dependency
impl UnwindSafe for Dependency
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.