pub trait Workspace:
Debug
+ Send
+ Sync {
Show 19 methods
// Required methods
fn name(&self) -> Option<&str>;
fn path(&self) -> &Path;
fn relative_path(&self) -> &Path;
fn version(&self) -> Option<&str>;
fn update_version<'life0, 'async_trait>(
&'life0 mut self,
update_type: UpdateType,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn language(&self) -> Language;
fn dependencies(&self) -> &HashSet<String>;
fn add_dependency(&mut self, dependency: &str);
fn is_changed(&self) -> bool;
fn set_changed(&mut self, changed: bool);
fn default_publish_command(&self) -> String;
fn default_dry_run_publish_command(&self) -> Option<String>;
// Provided methods
fn check_changed(&mut self, path: &Path) -> Result<()> { ... }
fn set_name(&mut self, _name: String) { ... }
fn publish<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Config,
) -> Pin<Box<dyn Future<Output = Result<PublishOutput>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn dry_run_publish<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Config,
) -> Pin<Box<dyn Future<Output = Result<Option<PublishOutput>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_publish_command(&self, config: &Config) -> String { ... }
fn get_dry_run_publish_command(&self, config: &Config) -> Option<String> { ... }
fn update_workspace_dependencies<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_packages: &'life1 [&'life2 dyn Package],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
Interface for monorepo workspace roots.
Extends Package behavior with workspace-specific operations like updating workspace dependencies. Implemented by language-specific workspace types.
Required Methods§
fn name(&self) -> Option<&str>
fn path(&self) -> &Path
fn relative_path(&self) -> &Path
fn version(&self) -> Option<&str>
Sourcefn update_version<'life0, 'async_trait>(
&'life0 mut self,
update_type: UpdateType,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_version<'life0, 'async_trait>(
&'life0 mut self,
update_type: UpdateType,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
§Errors
Returns error if the version update operation fails.
fn language(&self) -> Language
fn dependencies(&self) -> &HashSet<String>
fn add_dependency(&mut self, dependency: &str)
fn is_changed(&self) -> bool
fn set_changed(&mut self, changed: bool)
Sourcefn default_publish_command(&self) -> String
fn default_publish_command(&self) -> String
Get the default publish command for this workspace type
Sourcefn default_dry_run_publish_command(&self) -> Option<String>
fn default_dry_run_publish_command(&self) -> Option<String>
Get the default dry-run publish command for this workspace type.
Returns None for ecosystems whose default publish tool does not
support a built-in dry-run mode. Users may still provide an override
via config.publish_dry_run.
Provided Methods§
Sourcefn check_changed(&mut self, path: &Path) -> Result<()>
fn check_changed(&mut self, path: &Path) -> Result<()>
§Errors
Returns error if the parent path cannot be determined.
Excluded from coverage: see Package::check_changed for the same
tarpaulin attribution caveat on the multi-line && condition.
Sourcefn set_name(&mut self, _name: String)
fn set_name(&mut self, _name: String)
Set the workspace name (used for fallback when name is not found in manifest)
Sourcefn publish<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Config,
) -> Pin<Box<dyn Future<Output = Result<PublishOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn publish<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Config,
) -> Pin<Box<dyn Future<Output = Result<PublishOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Publish the workspace using the configured command or default
§Errors
Returns error if the publish command fails to spawn or the workspace directory is missing.
A non-zero exit code is reported via PublishOutput::success = false.
Sourcefn dry_run_publish<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Config,
) -> Pin<Box<dyn Future<Output = Result<Option<PublishOutput>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn dry_run_publish<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Config,
) -> Pin<Box<dyn Future<Output = Result<Option<PublishOutput>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run the publish command in dry-run mode to verify the pre-release flow works without actually publishing.
Returns Ok(Some(output)) with the captured command output, or
Ok(None) when the language does not support a dry-run mode and the
user has not provided an override in config.publish_dry_run.
§Errors
Returns error if the dry-run command fails to spawn or the workspace
directory is missing. A non-zero exit code is reported via
PublishOutput::success = false.
Sourcefn get_publish_command(&self, config: &Config) -> String
fn get_publish_command(&self, config: &Config) -> String
Get the publish command for this workspace, checking config first
Sourcefn get_dry_run_publish_command(&self, config: &Config) -> Option<String>
fn get_dry_run_publish_command(&self, config: &Config) -> Option<String>
Get the dry-run publish command for this workspace, checking config
first, then falling back to the workspace’s default_dry_run_publish_command.
fn update_workspace_dependencies<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_packages: &'life1 [&'life2 dyn Package],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".