Skip to main content

BinaryInstaller

Struct BinaryInstaller 

Source
pub struct BinaryInstaller<'invoker> { /* private fields */ }
Expand description

Stages and installs one release binary inside a distribution.

Implementations§

Source§

impl<'invoker> BinaryInstaller<'invoker>

Source

pub fn new( invoker: &'invoker WslInvoker<'invoker>, distribution: impl Into<String>, destination: LinuxBinaryPath, ) -> Self

Installs into destination in distribution.

Source

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.

Source

pub fn staging_directory(&self) -> String

Where the archive is unpacked: beside the destination, so that the final rename cannot cross a filesystem.

Source

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.

Trait Implementations§

Source§

impl<'invoker> Debug for BinaryInstaller<'invoker>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'invoker> !RefUnwindSafe for BinaryInstaller<'invoker>

§

impl<'invoker> !UnwindSafe for BinaryInstaller<'invoker>

§

impl<'invoker> Freeze for BinaryInstaller<'invoker>

§

impl<'invoker> Send for BinaryInstaller<'invoker>

§

impl<'invoker> Sync for BinaryInstaller<'invoker>

§

impl<'invoker> Unpin for BinaryInstaller<'invoker>

§

impl<'invoker> UnsafeUnpin for BinaryInstaller<'invoker>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more