[−][src]Struct cargo_edit::Dependency
A dependency handled by Cargo
Fields
name: String
The name of the dependency (as it is set in its Cargo.toml
and known to crates.io)
Methods
impl Dependency
[src]
pub fn new(name: &str) -> Dependency
[src]
Create a new dependency with a name
pub fn set_version(self, version: &str) -> Dependency
[src]
Set dependency to a given version
pub fn set_git(self, repo: &str) -> Dependency
[src]
Set dependency to a given repository
pub fn set_path(self, path: &str) -> Dependency
[src]
Set dependency to a given path
pub fn set_optional(self, opt: bool) -> Dependency
[src]
Set whether the dependency is optional
pub fn set_default_features(self, default_features: bool) -> Dependency
[src]
Set the value of default-features for the dependency
pub fn version(&self) -> Option<&str>
[src]
Get version of dependency
pub fn to_toml(&self) -> (String, Item)
[src]
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.)
Trait Implementations
impl Default for Dependency
[src]
fn default() -> Dependency
[src]
impl Clone for Dependency
[src]
fn clone(&self) -> Dependency
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<Dependency> for Dependency
[src]
fn eq(&self, other: &Dependency) -> bool
[src]
fn ne(&self, other: &Dependency) -> bool
[src]
impl Eq for Dependency
[src]
impl Hash for Dependency
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for Dependency
[src]
Auto Trait Implementations
impl Send for Dependency
impl Sync for Dependency
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,