Skip to main content

VersionFileHandler

Trait VersionFileHandler 

Source
pub trait VersionFileHandler: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn manifest_names(&self) -> &[&str];
    fn lock_file_names(&self) -> &[&str];
    fn bump(
        &self,
        path: &Path,
        new_version: &str,
    ) -> Result<Vec<PathBuf>, ReleaseError>;

    // Provided method
    fn detect(&self, dir: &Path) -> bool { ... }
}
Expand description

Trait encapsulating detection, bumping, workspace discovery, and lock file association for a single ecosystem (Cargo, npm, Python, etc.).

Required Methods§

Source

fn name(&self) -> &str

Human-readable name, e.g. “Cargo”, “npm”.

Source

fn manifest_names(&self) -> &[&str]

Primary manifest filenames, e.g. ["Cargo.toml"].

Source

fn lock_file_names(&self) -> &[&str]

Associated lock file names, e.g. ["Cargo.lock"].

Source

fn bump( &self, path: &Path, new_version: &str, ) -> Result<Vec<PathBuf>, ReleaseError>

Bump version in the manifest at path. Returns additional files that were auto-discovered and bumped (e.g. workspace members).

Provided Methods§

Source

fn detect(&self, dir: &Path) -> bool

Does this ecosystem exist in dir? Default: any manifest file exists.

Implementors§