pub struct WslHost { /* private fields */ }Expand description
The WSL adapter bound to a command runner.
Production builds one with WslHost::on_this_host, which refuses off
Windows. Tests build one with WslHost::with_runner and drive the whole
adapter from a script, on any platform.
Implementations§
Source§impl WslHost
impl WslHost
Sourcepub fn on_this_host(operation: &'static str) -> Result<Self, WslError>
pub fn on_this_host(operation: &'static str) -> Result<Self, WslError>
The real wsl.exe on this host.
§Errors
WslError::UnsupportedPlatform when this is not a Windows build.
Sourcepub fn with_runner(
runner: Box<dyn CommandRunner>,
executable: WslExecutable,
) -> Self
pub fn with_runner( runner: Box<dyn CommandRunner>, executable: WslExecutable, ) -> Self
An adapter over an injected runner, for a test or a fixture.
Sourcepub fn executable(&self) -> &WslExecutable
pub fn executable(&self) -> &WslExecutable
The wsl.exe this will run.
Sourcepub fn invoker(&self) -> WslInvoker<'_>
pub fn invoker(&self) -> WslInvoker<'_>
Runs wsl.exe and the commands inside a distribution.
Sourcepub fn tasks(&self) -> LifecycleTaskControl<'_>
pub fn tasks(&self) -> LifecycleTaskControl<'_>
Registers, reads and removes the Windows lifecycle task.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WslHost
impl !UnwindSafe for WslHost
impl Freeze for WslHost
impl Send for WslHost
impl Sync for WslHost
impl Unpin for WslHost
impl UnsafeUnpin for WslHost
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more