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
fn new(dep: Dependency) -> Self
fn apply_summary(&mut self, summary: &Summary)
fn features(&self) -> (IndexSet<&str>, IndexSet<&str>)
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,
gctx: &GlobalContext,
) -> CargoResult<MaybeWorkspace<SourceId>>
pub fn source_id( &self, gctx: &GlobalContext, ) -> CargoResult<MaybeWorkspace<SourceId>>
Get the SourceID for this dependency.
sourcepub fn query(
&self,
gctx: &GlobalContext,
) -> CargoResult<MaybeWorkspace<Dependency>>
pub fn query( &self, gctx: &GlobalContext, ) -> 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<'a>(
&self,
gctx: &GlobalContext,
workspace_root: &Path,
crate_root: &Path,
unstable_features: &Features,
) -> CargoResult<Item>
pub fn to_toml<'a>( &self, gctx: &GlobalContext, workspace_root: &Path, crate_root: &Path, unstable_features: &Features, ) -> CargoResult<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, 'a>(
&self,
gctx: &GlobalContext,
workspace_root: &Path,
crate_root: &Path,
unstable_features: &Features,
key: &mut KeyMut<'k>,
item: &mut Item,
) -> CargoResult<()>
pub fn update_toml<'k, 'a>( &self, gctx: &GlobalContext, workspace_root: &Path, crate_root: &Path, unstable_features: &Features, key: &mut KeyMut<'k>, item: &mut Item, ) -> CargoResult<()>
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 Freeze for DependencyUI
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§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>,
§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: 408 bytes