silk.platform.native.process.
Runs a child process with the system calls, for the native ChildProcess provider.
When to use#
silk.system.child_process_native uses NativeProcess.execute. Application code uses the ChildProcess
effect from silk.system.child_process instead.
Details#
Each call owns its descriptors, its copies of the request, and its child. If a step fails after the child started, the call stops and waits for the child, closes the descriptors, and then returns the first error.
Gotchas#
The calls block the thread.
A trap does not clean up, and does not stop the child.
Import as NativeProcess with import silk.platform.native.process { NativeProcess }.
Public declarations: 1.
NativeProcess#
pub struct NativeProcessThe function that runs a child process with the system calls, for the native ChildProcess
provider.
When to use#
silk.system.child_process_native uses NativeProcess.execute. Application code uses the
ChildProcess effect from silk.system.child_process instead.
Implementation NativeProcess#
impl NativeProcessAssociated function execute#
pub effect fn execute(request: &ProcessRequest) -> ProcessOutcome
! ProcessError | OutOfMemoryError
? &mut AllocatorStarts the program of request, waits for it to end, and returns its outcome with all of
its output.
Details#
The child gets the arguments and the environment of the request, and the working directory of the request, or of the parent when it is empty. Its standard input is closed. A failure to start is an error. An exit code that is not 0, and an end by a signal, are outcomes.
Gotchas#
The call blocks the thread. Do not wait for the child in other code. If a step fails after the child started, the call stops and waits for the child, closes the descriptors, and then returns the first error. A trap does not clean up, and does not stop the child.
Category: Native platform.
Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, x86_64-unknown-linux-gnu.