Enum cargo_toml::Dependency
source · pub enum Dependency {
Simple(String),
Inherited(InheritedDependencyDetail),
Detailed(DependencyDetail),
}
Expand description
Dependency definition. Note that this struct doesn’t carry it’s key/name, which you need to read from its section.
It can be simple version number, or detailed settings, or inherited.
Variants§
Simple(String)
Version
Inherited(InheritedDependencyDetail)
Incomplete data
Detailed(DependencyDetail)
Implementations§
source§impl Dependency
impl Dependency
sourcepub fn detail(&self) -> Option<&DependencyDetail>
pub fn detail(&self) -> Option<&DependencyDetail>
Get object with special dependency settings if it’s not just a version number.
sourcepub fn detail_mut(&mut self) -> &mut DependencyDetail
pub fn detail_mut(&mut self) -> &mut DependencyDetail
Panics if inherited value is not available
sourcepub fn req_features(&self) -> &[String]
pub fn req_features(&self) -> &[String]
Enable extra features for this dep.
sourcepub fn optional(&self) -> bool
pub fn optional(&self) -> bool
Is it optional. Note that optional deps can be used as features, unless features use dep:
/?
syntax for them..
sourcepub fn package(&self) -> Option<&str>
pub fn package(&self) -> Option<&str>
Some
if it overrides the package name.
If None
, use the dependency name as the package name.
sourcepub fn is_crates_io(&self) -> bool
pub fn is_crates_io(&self) -> bool
true
if it’s an usual crates.io dependency,
false
if git/path/alternative registry
Trait Implementations§
source§impl Clone for Dependency
impl Clone for Dependency
source§fn clone(&self) -> Dependency
fn clone(&self) -> Dependency
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Dependency
impl Debug for Dependency
source§impl<'de> Deserialize<'de> for Dependency
impl<'de> Deserialize<'de> for Dependency
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Dependency
impl PartialEq for Dependency
source§fn eq(&self, other: &Dependency) -> bool
fn eq(&self, other: &Dependency) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Dependency
impl Serialize for Dependency
impl StructuralPartialEq for Dependency
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§
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
Mutably borrows from an owned value. Read more