Struct cargo::ops::cargo_add::DependencyUI
source · pub struct DependencyUI { /* private fields */ }
Expand description
Track presentation-layer information with the editable representation of a [dependencies]
entry (Dependency)
Methods from Deref<Target = Dependency>§
sourcepub fn default_features(&self) -> Option<bool>
pub fn default_features(&self) -> Option<bool>
Whether default features are activated.
sourcepub fn source_id(
&self,
config: &Config
) -> CargoResult<MaybeWorkspace<SourceId>>
pub fn source_id( &self, config: &Config ) -> CargoResult<MaybeWorkspace<SourceId>>
Get the SourceID for this dependency.
sourcepub fn query(&self, config: &Config) -> CargoResult<MaybeWorkspace<Dependency>>
pub fn query(&self, config: &Config) -> CargoResult<MaybeWorkspace<Dependency>>
Query to find this dependency.
sourcepub fn toml_key(&self) -> &str
pub fn toml_key(&self) -> &str
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).
sourcepub fn to_toml(&self, crate_root: &Path) -> Item
pub fn to_toml(&self, crate_root: &Path) -> Item
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
sourcepub fn update_toml<'k>(
&self,
crate_root: &Path,
key: &mut KeyMut<'k>,
item: &mut Item
)
pub fn update_toml<'k>( &self, crate_root: &Path, key: &mut KeyMut<'k>, item: &mut Item )
Modify existing entry to match this dependency.