pub struct JavaRuntime(pub PathBuf);Expand description
Wrapper around a Java binary path for process execution
Tuple Fields§
§0: PathBufImplementations§
Source§impl JavaRuntime
impl JavaRuntime
Sourcepub async fn execute(
&self,
arguments: Vec<String>,
game_dir: &Path,
) -> JavaRuntimeResult<Child>
pub async fn execute( &self, arguments: Vec<String>, game_dir: &Path, ) -> JavaRuntimeResult<Child>
Spawns a Java process with the given arguments in game_dir.
Sourcepub async fn handle_io<D: Send + Sync>(
&self,
process: &mut Child,
on_stdout: fn(&D, &[u8]) -> JavaRuntimeResult<()>,
on_stderr: fn(&D, &[u8]) -> JavaRuntimeResult<()>,
terminator: Receiver<()>,
data: &D,
) -> JavaRuntimeResult<()>
pub async fn handle_io<D: Send + Sync>( &self, process: &mut Child, on_stdout: fn(&D, &[u8]) -> JavaRuntimeResult<()>, on_stderr: fn(&D, &[u8]) -> JavaRuntimeResult<()>, terminator: Receiver<()>, data: &D, ) -> JavaRuntimeResult<()>
Streams stdout/stderr from the process with custom handlers.
Calls on_stdout/on_stderr callbacks until the process exits or
terminator fires. Exit code -1073740791 (Windows forceful termination)
is not treated as an error.
Auto Trait Implementations§
impl Freeze for JavaRuntime
impl RefUnwindSafe for JavaRuntime
impl Send for JavaRuntime
impl Sync for JavaRuntime
impl Unpin for JavaRuntime
impl UnsafeUnpin for JavaRuntime
impl UnwindSafe for JavaRuntime
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