pub struct InstanceHandle { /* private fields */ }Expand description
Handle for an instance after launching it. You must make sure to use .wait() so that the child process is awaited.
Implementations§
Source§impl InstanceHandle
impl InstanceHandle
Sourcepub fn wait(&mut self) -> Result<ExitStatus>
pub fn wait(&mut self) -> Result<ExitStatus>
Waits for the process to complete
Sourcepub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
pub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
Returns the exit status of the instance process if it has finished
Sourcepub fn get_process(self) -> Child
pub fn get_process(self) -> Child
Gets the internal child process for the game, consuming the InstanceHandle and removing the stdio files
Sourcepub fn stdout_path(&self) -> &Path
pub fn stdout_path(&self) -> &Path
Gets the stdout path of the instance process
Sourcepub fn stdin(&mut self) -> Option<&mut File>
pub fn stdin(&mut self) -> Option<&mut File>
Gets the stdin file of the instance process. Empty if it is piped.
Sourcepub fn stdin_path(&self) -> Option<&Path>
pub fn stdin_path(&self) -> Option<&Path>
Gets the stdin path of the instance process. Empty if it is piped.
Sourcepub fn write_stdin(&mut self, data: &[u8]) -> Result<()>
pub fn write_stdin(&mut self, data: &[u8]) -> Result<()>
Writes to stdin
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InstanceHandle
impl RefUnwindSafe for InstanceHandle
impl Send for InstanceHandle
impl Sync for InstanceHandle
impl Unpin for InstanceHandle
impl UnsafeUnpin for InstanceHandle
impl UnwindSafe for InstanceHandle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more