Skip to main content

Manager

Trait Manager 

Source
pub trait Manager {
    // Required methods
    fn reloader_type(&self) -> String;
    fn check_preconditions(
        &self,
        reloader_config: &ReloaderConfig,
        caproni_config: &CaproniConfig,
        get_tool_version: &dyn Fn(&str) -> Option<String>,
    ) -> Result<(), Box<dyn Error + Send + Sync>>;
    fn run(
        &self,
        reloader_config: &ReloaderConfig,
        caproni_config: &CaproniConfig,
        kubeconfig_path: &str,
    ) -> Result<(), Box<dyn Error + Send + Sync>>;
    fn status(
        &self,
        reloader_config: &ReloaderConfig,
        caproni_config: &CaproniConfig,
    ) -> Result<Status, Box<dyn Error + Send + Sync>>;
    fn validate(
        &self,
        reloader_config: &ReloaderConfig,
        caproni_config: &CaproniConfig,
    ) -> Result<(), Box<dyn Error + Send + Sync>>;
}
Expand description

The interface for managing local development processes. Implementations are responsible for running processes with hot-reload capabilities using specific strategies (e.g. mirrord, skaffold).

Required Methods§

Source

fn reloader_type(&self) -> String

The reloader type that this manager handles (e.g. "mirror", "skaffold").

Source

fn check_preconditions( &self, reloader_config: &ReloaderConfig, caproni_config: &CaproniConfig, get_tool_version: &dyn Fn(&str) -> Option<String>, ) -> Result<(), Box<dyn Error + Send + Sync>>

Verifies that the environment is ready for this reloader to run. For example, mirror reloaders check that no stale *-caproni deployments exist. Returns Ok(()) if all preconditions are met.

Source

fn run( &self, reloader_config: &ReloaderConfig, caproni_config: &CaproniConfig, kubeconfig_path: &str, ) -> Result<(), Box<dyn Error + Send + Sync>>

Runs the reloader processes, blocking until cancelled.

kubeconfig_path is the path to a temporary kubeconfig for the caproni-selected cluster (created and owned by the caller). Implementations that launch external tooling should pin it to this kubeconfig rather than relying on the user’s global current-context. It may be empty.

Source

fn status( &self, reloader_config: &ReloaderConfig, caproni_config: &CaproniConfig, ) -> Result<Status, Box<dyn Error + Send + Sync>>

Returns the current status of the reloader. Returns an error if unable to determine reloader state.

Source

fn validate( &self, reloader_config: &ReloaderConfig, caproni_config: &CaproniConfig, ) -> Result<(), Box<dyn Error + Send + Sync>>

Validates the reloader configuration and referenced files. Returns Ok(()) if valid, or an error describing validation failures. Files in uncloned repository directories should not cause validation to fail.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§