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 dependency to a given path

Panic

Panics if the path is relative

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

Get version of dependency

Get the path of the dependency

Get the alias for the dependency (if any)

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 a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. 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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.