pub trait UpdateRunner {
// Required methods
fn download(&self, url: &str, dest: &Path) -> Result<()>;
fn fetch_checksum(&self, url: &str) -> Result<Option<String>>;
fn run_installer(&self, installer_path: &Path) -> Result<()>;
}Expand description
Side-effect abstraction for apply_with. The real implementation
downloads via HTTP and runs sh / powershell; tests inject a fake
that records calls.
Required Methods§
fn download(&self, url: &str, dest: &Path) -> Result<()>
Sourcefn fetch_checksum(&self, url: &str) -> Result<Option<String>>
fn fetch_checksum(&self, url: &str) -> Result<Option<String>>
Fetch the published sha256 sidecar for an asset (the
<asset-url>.sha256 convention). Ok(None) means the release
simply doesn’t publish one (older releases); an HTTP/transport
failure is a hard Err so a blocked checksum fetch can’t be
mistaken for an absent one.
fn run_installer(&self, installer_path: &Path) -> Result<()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".