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§
Sourcefn reloader_type(&self) -> String
fn reloader_type(&self) -> String
The reloader type that this manager handles (e.g. "mirror",
"skaffold").
Sourcefn check_preconditions(
&self,
reloader_config: &ReloaderConfig,
caproni_config: &CaproniConfig,
get_tool_version: &dyn Fn(&str) -> Option<String>,
) -> Result<(), Box<dyn Error + Send + Sync>>
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.
Sourcefn run(
&self,
reloader_config: &ReloaderConfig,
caproni_config: &CaproniConfig,
kubeconfig_path: &str,
) -> Result<(), Box<dyn Error + Send + Sync>>
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.
Sourcefn status(
&self,
reloader_config: &ReloaderConfig,
caproni_config: &CaproniConfig,
) -> Result<Status, Box<dyn Error + Send + Sync>>
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.
Sourcefn validate(
&self,
reloader_config: &ReloaderConfig,
caproni_config: &CaproniConfig,
) -> Result<(), Box<dyn Error + Send + Sync>>
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".