Struct crates_index::Dependency
source · pub struct Dependency { /* private fields */ }
Expand description
A single dependency of a specific crate version
Implementations
sourceimpl Dependency
impl Dependency
pub fn name(&self) -> &str
pub fn requirement(&self) -> &str
pub fn features(&self) -> &[String]
pub fn is_optional(&self) -> bool
pub fn has_default_features(&self) -> bool
pub fn target(&self) -> Option<&str>
pub fn kind(&self) -> Option<&str>
pub fn package(&self) -> Option<&str>
sourcepub fn crate_name(&self) -> &str
pub fn crate_name(&self) -> &str
Returns the name of the crate providing the dependency.
This is equivalent to name()
unless self.package()
is not None
, in which case it’s equal to self.package()
.
Basically, you can define a dependency in your Cargo.toml
like this:
serde_lib = {version = "1", package = "serde"}
…which means that it uses the crate serde
but imports
it under the name serde_lib
.
Trait Implementations
sourceimpl Clone for Dependency
impl Clone for Dependency
sourcefn clone(&self) -> Dependency
fn clone(&self) -> Dependency
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for Dependency
impl Debug for Dependency
sourceimpl<'de> Deserialize<'de> for Dependency
impl<'de> Deserialize<'de> for Dependency
sourcefn 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
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more