Struct cargo_workspace2::models::Crate [−][src]
A crate in a cargo workspace
Has a name, path (stored as the offset of the root), and set of dependencies inside the workspace. To get the dependents of this crate, query the dependency graph with the set of other crate IDs.
Fields
id: CrateId
Numeric Id of this crate
name: String
Package name, not the folder name
cc: CargoCrate
Path offset of the workspace root
dependencies: BTreeSet<CrateId>
List of dependencies this crate has inside this workspace
Implementations
impl Crate
[src]
pub fn new(cc: CargoCrate) -> Self
[src]
pub fn process(&mut self, g: &DepGraph)
[src]
Call this function once all crates have been loaded into scope
pub fn name(&self) -> &String
[src]
Get the crate name
pub fn path(&self) -> &PathBuf
[src]
Get the crate path
pub fn version(&self) -> String
[src]
Get the current version
pub fn add_dependency(&mut self, id: CrateId)
[src]
Add a dependency of this crate
pub fn has_dependency(&self, id: CrateId) -> bool
[src]
Check if this crate has a particular dependency
pub fn change_dependency(&mut self, dep: &String, new_ver: &String)
[src]
pub fn publish(&mut self, new_version: String)
[src]
Publish a new version of this crate
pub fn sync(&mut self)
[src]
Trait Implementations
impl Clone for Crate
[src]
impl Debug for Crate
[src]
impl Eq for Crate
[src]
impl Ord for Crate
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Crate> for Crate
[src]
impl PartialOrd<Crate> for Crate
[src]
Auto Trait Implementations
impl RefUnwindSafe for Crate
[src]
impl Send for Crate
[src]
impl Sync for Crate
[src]
impl Unpin for Crate
[src]
impl UnwindSafe for Crate
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,