Struct cargo::ops::cargo_add::DependencyUI
source · pub struct DependencyUI {
dep: Dependency,
available_version: Option<Version>,
available_features: BTreeMap<String, Vec<String>>,
}
Expand description
Track presentation-layer information with the editable representation of a [dependencies]
entry (Dependency)
Fields§
§dep: Dependency
Editable representation of a [depednencies]
entry
available_version: Option<Version>
The version of the crate that we pulled available_features
from
available_features: BTreeMap<String, Vec<String>>
The widest set of features compatible with Dependency
s version requirement
Implementations§
source§impl DependencyUI
impl DependencyUI
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.
Trait Implementations§
source§impl Deref for DependencyUI
impl Deref for DependencyUI
source§impl Display for DependencyUI
impl Display for DependencyUI
Auto Trait Implementations§
impl RefUnwindSafe for DependencyUI
impl Send for DependencyUI
impl Sync for DependencyUI
impl Unpin for DependencyUI
impl UnwindSafe for DependencyUI
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 416 bytes