pub struct WorkspaceMetadata { /* private fields */ }Expand description
Workspace metadata wrapper.
Implementations§
Source§impl WorkspaceMetadata
impl WorkspaceMetadata
Sourcepub fn load(manifest_path: &Path) -> Result<Self>
pub fn load(manifest_path: &Path) -> Result<Self>
Load workspace metadata from a manifest path.
Sourcepub fn load_from_current_dir() -> Result<Self>
pub fn load_from_current_dir() -> Result<Self>
Load metadata from the current directory.
Sourcepub fn workspace_root(&self) -> &Path
pub fn workspace_root(&self) -> &Path
Workspace root directory.
Sourcepub fn all_packages(&self) -> Vec<&Package>
pub fn all_packages(&self) -> Vec<&Package>
All packages in the workspace.
Sourcepub fn publishable_packages(&self) -> Vec<&Package>
pub fn publishable_packages(&self) -> Vec<&Package>
Packages that are publishable (not excluded from publishing).
Sourcepub fn is_publishable(&self, package: &Package) -> bool
pub fn is_publishable(&self, package: &Package) -> bool
Check if a package is publishable.
Sourcepub fn get_package(&self, name: &str) -> Option<&Package>
pub fn get_package(&self, name: &str) -> Option<&Package>
Look up a package by name.
Sourcepub fn workspace_members(&self) -> Vec<&Package>
pub fn workspace_members(&self) -> Vec<&Package>
Workspace members.
Sourcepub fn root_package(&self) -> Option<&Package>
pub fn root_package(&self) -> Option<&Package>
Root package (if any).
Sourcepub fn workspace_name(&self) -> &str
pub fn workspace_name(&self) -> &str
Workspace name (from the root package or directory name).
Sourcepub fn topological_order(&self) -> Result<Vec<String>>
pub fn topological_order(&self) -> Result<Vec<String>>
Packages in topological order (dependencies first).
Trait Implementations§
Source§impl Clone for WorkspaceMetadata
impl Clone for WorkspaceMetadata
Source§fn clone(&self) -> WorkspaceMetadata
fn clone(&self) -> WorkspaceMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WorkspaceMetadata
impl RefUnwindSafe for WorkspaceMetadata
impl Send for WorkspaceMetadata
impl Sync for WorkspaceMetadata
impl Unpin for WorkspaceMetadata
impl UnsafeUnpin for WorkspaceMetadata
impl UnwindSafe for WorkspaceMetadata
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