Struct cargo_workspace2::models::CargoCrate[][src]

pub struct CargoCrate {
    pub doc: Document,
    pub path: PathBuf,
    pub dependencies: Vec<Dependency>,
}

Initial representation of a crate, before being parsed

Fields

doc: Documentpath: PathBufdependencies: Vec<Dependency>

Implementations

impl CargoCrate[src]

pub fn name(&self) -> String[src]

Get the crate name from the inner document

pub fn version(&self) -> String[src]

Get the current version

pub fn dep_by_name(&self, name: &String) -> &Dependency[src]

Find a cargo dependency by name

pub fn change_dep(&mut self, dep: &String, ver: &String)[src]

pub fn all_deps_mut(&mut self) -> Vec<&mut Dependency>[src]

pub fn has_version(&self, name: &String) -> bool[src]

Check if this crate depends on a specific version of another

pub fn has_path(&self, name: &String) -> bool[src]

Check if this crate depends on a specific path of another

pub fn set_version(&mut self, version: String)[src]

Set a new version for this crate

pub fn sync(&mut self)[src]

Sync any changes made to the document to disk

Trait Implementations

impl Clone for CargoCrate[src]

impl Debug for CargoCrate[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.