pub struct Package { /* private fields */ }Expand description
A package in the workspace.
Implementations§
Source§impl Package
impl Package
Sourcepub fn new<S>(name: S) -> Self
pub fn new<S>(name: S) -> Self
Create a Package with the given name.
This uses the current directory as the the workspace path.
Sourcepub fn with_workspace<S, P>(name: S, workspace: P) -> Self
pub fn with_workspace<S, P>(name: S, workspace: P) -> Self
Create a Package with the given name and workspace.
The workspace directory should be the root of the workspace, or just the directory of the package in non-workspace projects.
Sourcepub fn get_git_tag_name(&self, local_version: &str) -> String
pub fn get_git_tag_name(&self, local_version: &str) -> String
Format a package version as a git tag.
Sourcepub fn get_local_version(&self) -> Result<String, GetLocalVersionError>
pub fn get_local_version(&self) -> Result<String, GetLocalVersionError>
Use cargo metadata to get the local version of a package
in the workspace.
Trait Implementations§
Source§impl Ord for Package
impl Ord for Package
Source§impl PartialOrd for Package
impl PartialOrd for Package
impl Eq for Package
impl StructuralPartialEq for Package
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnwindSafe for Package
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