pub struct BinaryInstaller<'invoker> { /* private fields */ }Expand description
Stages and installs one release binary inside a distribution.
Implementations§
Source§impl<'invoker> BinaryInstaller<'invoker>
impl<'invoker> BinaryInstaller<'invoker>
Sourcepub fn new(
invoker: &'invoker WslInvoker<'invoker>,
distribution: impl Into<String>,
destination: LinuxBinaryPath,
) -> Self
pub fn new( invoker: &'invoker WslInvoker<'invoker>, distribution: impl Into<String>, destination: LinuxBinaryPath, ) -> Self
Installs into destination in distribution.
Sourcepub fn with_staging_token(self, token: impl Into<String>) -> Self
pub fn with_staging_token(self, token: impl Into<String>) -> Self
Fixes the random part of the staging directory’s name.
Only a test needs this. It exists so that the argument vectors this module builds can be asserted exactly, rather than matched with a pattern that would also match a mistake.
Sourcepub fn staging_directory(&self) -> String
pub fn staging_directory(&self) -> String
Where the archive is unpacked: beside the destination, so that the final rename cannot cross a filesystem.
Sourcepub fn install(
&self,
archive: &Path,
artifact: &PublishedArtifact,
target: &ReleaseTarget,
) -> Result<InstalledBinary, WslError>
pub fn install( &self, archive: &Path, artifact: &PublishedArtifact, target: &ReleaseTarget, ) -> Result<InstalledBinary, WslError>
Verifies the archive, unpacks it, checks the version, and renames it into place.
§Errors
WslError::DigestMismatch or WslError::UnreadableArchive before
anything is sent; WslError::CommandFailed from any Linux step; and
WslError::VersionMismatch when the archive turned out to hold a
different build. In every one of those cases the destination is
untouched and the staging directory has been removed.