pub struct PipetteClient { /* private fields */ }
Expand description
A client to a running pipette
instance inside a VM.
Implementations§
Source§impl PipetteClient
impl PipetteClient
Sourcepub async fn new(
spawner: impl Spawn,
conn: impl 'static + AsyncRead + AsyncWrite + Send + Unpin,
output_dir: &Path,
) -> Result<Self, RecvError>
pub async fn new( spawner: impl Spawn, conn: impl 'static + AsyncRead + AsyncWrite + Send + Unpin, output_dir: &Path, ) -> Result<Self, RecvError>
Connects to a pipette
instance inside a VM.
conn
must be an established connection over some byte stream (e.g., a
socket).
Sourcepub fn windows_shell(&self) -> WindowsShell<'_>
pub fn windows_shell(&self) -> WindowsShell<'_>
Return a shell object to interact with a Windows guest.
Sourcepub fn unix_shell(&self) -> UnixShell<'_>
pub fn unix_shell(&self) -> UnixShell<'_>
Return a shell object to interact with a Linux guest.
Sourcepub fn command(&self, program: impl AsRef<str>) -> Command<'_>
pub fn command(&self, program: impl AsRef<str>) -> Command<'_>
Returns an object used to launch a command inside the guest.
TODO: this is a low-level interface. Make a high-level interface like
xshell::Shell
for manipulating the environment and launching
processes.
Sourcepub async fn read_file(&self, path: impl AsRef<str>) -> Result<Vec<u8>>
pub async fn read_file(&self, path: impl AsRef<str>) -> Result<Vec<u8>>
Reads the full contents of a file.
Auto Trait Implementations§
impl Freeze for PipetteClient
impl !RefUnwindSafe for PipetteClient
impl Send for PipetteClient
impl Sync for PipetteClient
impl Unpin for PipetteClient
impl !UnwindSafe for PipetteClient
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